Skip to content

Commit

Permalink
Update detect-api-changes.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
goergisn authored Feb 11, 2025
1 parent d29d134 commit 1b11435
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/detect-api-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,28 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 👾 Define Diff Versions
run: |
NEW="${{ env.source }}~${{ env.githubRepo }}"
if [[ '${{ github.head_ref || env.noTargetBranch }}' == release/* ]]
NEW="${{ env.source }}~${{ env.headGithubRepo }}"
OLD="${{ env.target }}~${{ env.baseGithubRepo }}"
if [[ '${{ env.targetBranchName || env.noTargetBranch }}' == release/* ]]
then
LATEST_TAG=$(git describe --tags --abbrev=0)
OLD="$LATEST_TAG~${{ env.githubRepo }}"
else
OLD="${{ env.target }}~${{ env.githubRepo }}"
OLD="$LATEST_TAG~${{ env.baseGithubRepo }}"
fi
echo "OLD=$OLD"
echo "NEW=$NEW"
# Providing the output to the environment
echo "OLD_VERSION=$OLD" >> $GITHUB_ENV
echo "NEW_VERSION=$NEW" >> $GITHUB_ENV
env:
source: '${{ github.event.inputs.new || github.head_ref }}'
target: '${{ github.event.inputs.old || github.event.pull_request.base.ref }}'
githubRepo: '${{github.server_url}}/${{github.repository}}.git'
headGithubRepo: '${{github.server_url}}/${{ github.event.pull_request.head.repo.full_name || github.repository}}.git'
baseGithubRepo: '${{github.server_url}}/${{github.repository}}.git'
noTargetBranch: 'no target branch'
targetBranchName: '${{ github.head_ref }}'

- name: 🧰 Build Swift CLI
run: swift build --configuration release
Expand Down

0 comments on commit 1b11435

Please sign in to comment.