@@ -31,29 +31,28 @@ jobs:
31
31
uses : actions/checkout@v4
32
32
with :
33
33
fetch-depth : 0
34
-
34
+
35
35
- name : 👾 Define Diff Versions
36
36
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/* ]]
39
41
then
40
42
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 }}"
44
44
fi
45
45
46
- echo "OLD=$OLD"
47
- echo "NEW=$NEW"
48
-
49
46
# Providing the output to the environment
50
47
echo "OLD_VERSION=$OLD" >> $GITHUB_ENV
51
48
echo "NEW_VERSION=$NEW" >> $GITHUB_ENV
52
49
env :
53
50
source : ' ${{ github.event.inputs.new || github.head_ref }}'
54
51
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'
56
54
noTargetBranch : ' no target branch'
55
+ targetBranchName : ' ${{ github.head_ref }}'
57
56
58
57
- name : 🧰 Build Swift CLI
59
58
run : swift build --configuration release
0 commit comments