@@ -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