Skip to content

Commit 339add5

Browse files
authored
Merge pull request #157 from Adyen/goergisn-patch-1
Fixed action.yml issues
2 parents c64eef3 + 4c4c5a6 commit 339add5

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

action.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,43 @@ inputs:
1010
old:
1111
description: 'Specify the old version to compare to'
1212
required: true
13-
13+
comment_tag:
14+
description: 'The tag to use for the PR comment (default: api_changes_[PLATFORM])'
15+
required: false
16+
1417
runs:
1518
using: 'composite'
1619
steps:
1720
- name: 🍱 Compute prerequisites
1821
run: |
19-
echo "VERSION_NUMBER=0.11.1" >> $GITHUB_ENV
22+
echo "ACTION_REF=$action_ref" >> $GITHUB_ENV
2023
echo "BINARY_PATH=$(swift build --configuration release --show-bin-path)/public-api-diff" >> $GITHUB_ENV
2124
echo "HEAD_GITHUB_REPO=${{github.server_url}}/${{ github.event.pull_request.head.repo.full_name || github.repository}}.git" >> $GITHUB_ENV
2225
echo "BASE_GITHUB_REPO=${{github.server_url}}/${{github.repository}}.git" >> $GITHUB_ENV
2326
echo "PROJECT_FOLDER=$(pwd)" >> $GITHUB_ENV
27+
echo "COMMENT_TAG=$final_comment_tag" >> $GITHUB_ENV
2428
shell: bash
29+
env:
30+
action_ref: ${{ github.action_ref }}
31+
final_comment_tag: ${{ inputs.comment_tag || format('api_changes_{0}', inputs.platform) }}
2532

2633
- uses: actions/checkout@v6
2734
with:
2835
repository: "Adyen/adyen-swift-public-api-diff"
29-
ref: ${{ env.VERSION_NUMBER }}
36+
ref: ${{ env.ACTION_REF }}
3037

38+
- name: 🔍 Get action commit SHA
39+
run: |
40+
echo "ACTION_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
41+
shell: bash
42+
3143
- name: 🛻 Restore Binary
3244
id: cache-restore
3345
uses: actions/cache/restore@v5
3446
with:
3547
path: ${{ env.BINARY_PATH }}
36-
key: build-cache-${{ runner.os }}-${{ env.VERSION_NUMBER }}
37-
48+
key: build-cache-${{ runner.os }}-${{ env.ACTION_SHA }}
49+
3850
- name: 🧰 Build Swift CLI
3951
if: steps.cache-restore.outputs.cache-hit != 'true'
4052
run: swift build --configuration release
@@ -49,14 +61,14 @@ runs:
4961
echo "Binary found at ${{ env.BINARY_PATH }}"
5062
fi
5163
shell: bash
52-
64+
5365
- name: 💾 Save Binary
5466
if: steps.cache-restore.outputs.cache-hit != 'true'
5567
uses: actions/cache/save@v5
5668
with:
5769
path: ${{ env.BINARY_PATH }}
58-
key: build-cache-${{ runner.os }}-${{ env.VERSION_NUMBER }}
59-
70+
key: build-cache-${{ runner.os }}-${{ env.ACTION_SHA }}
71+
6072
- name: 🏃 Run Diff
6173
run: |
6274
NEW=${{ inputs.new }}
@@ -87,5 +99,5 @@ runs:
8799
uses: thollander/actions-comment-pull-request@v3
88100
with:
89101
file-path: "${{ github.workspace }}/api_comparison.md"
90-
comment-tag: api_changes
102+
comment-tag: ${{ env.COMMENT_TAG }}
91103
mode: recreate

0 commit comments

Comments
 (0)