Skip to content

Commit 1b11435

Browse files
authored
Update detect-api-changes.yml
1 parent d29d134 commit 1b11435

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/detect-api-changes.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,28 @@ jobs:
3131
uses: actions/checkout@v4
3232
with:
3333
fetch-depth: 0
34-
34+
3535
- name: 👾 Define Diff Versions
3636
run: |
37-
NEW="${{ env.source }}~${{ env.githubRepo }}"
38-
if [[ '${{ github.head_ref || env.noTargetBranch }}' == release/* ]]
37+
NEW="${{ env.source }}~${{ env.headGithubRepo }}"
38+
OLD="${{ env.target }}~${{ env.baseGithubRepo }}"
39+
40+
if [[ '${{ env.targetBranchName || env.noTargetBranch }}' == release/* ]]
3941
then
4042
LATEST_TAG=$(git describe --tags --abbrev=0)
41-
OLD="$LATEST_TAG~${{ env.githubRepo }}"
42-
else
43-
OLD="${{ env.target }}~${{ env.githubRepo }}"
43+
OLD="$LATEST_TAG~${{ env.baseGithubRepo }}"
4444
fi
4545
46-
echo "OLD=$OLD"
47-
echo "NEW=$NEW"
48-
4946
# Providing the output to the environment
5047
echo "OLD_VERSION=$OLD" >> $GITHUB_ENV
5148
echo "NEW_VERSION=$NEW" >> $GITHUB_ENV
5249
env:
5350
source: '${{ github.event.inputs.new || github.head_ref }}'
5451
target: '${{ github.event.inputs.old || github.event.pull_request.base.ref }}'
55-
githubRepo: '${{github.server_url}}/${{github.repository}}.git'
52+
headGithubRepo: '${{github.server_url}}/${{ github.event.pull_request.head.repo.full_name || github.repository}}.git'
53+
baseGithubRepo: '${{github.server_url}}/${{github.repository}}.git'
5654
noTargetBranch: 'no target branch'
55+
targetBranchName: '${{ github.head_ref }}'
5756

5857
- name: 🧰 Build Swift CLI
5958
run: swift build --configuration release

0 commit comments

Comments
 (0)