File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -171,13 +171,15 @@ jobs:
171171
172172 - name : Check if the `pythonbuild` crate changed
173173 id : check-pythonbuild
174+ env :
175+ BASE_REF : ${{ github.event.pull_request.base.ref || 'main' }}
174176 run : |
175- if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
177+ merge_base=$(git merge-base HEAD "origin/${BASE_REF}")
178+ if git diff --quiet "${merge_base}...HEAD" -- ':src/*.rs'; then
176179 echo "changed=false" >> "$GITHUB_OUTPUT"
177180 else
178181 echo "changed=true" >> "$GITHUB_OUTPUT"
179182 fi
180-
181183
182184 build-0 :
183185 needs :
Original file line number Diff line number Diff line change @@ -81,12 +81,16 @@ jobs:
8181
8282 - name : Check if the `pythonbuild` crate changed
8383 id : check-pythonbuild
84+ env :
85+ BASE_REF : ${{ github.event.pull_request.base.ref || 'main' }}
8486 run : |
85- if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
87+ merge_base=$(git merge-base HEAD "origin/${BASE_REF}")
88+ if git diff --quiet "${merge_base}...HEAD" -- ':src/*.rs'; then
8689 echo "changed=false" >> "$GITHUB_OUTPUT"
8790 else
8891 echo "changed=true" >> "$GITHUB_OUTPUT"
8992 fi
93+
9094 build :
9195 needs :
9296 - generate-matrix
Original file line number Diff line number Diff line change @@ -79,12 +79,13 @@ jobs:
7979 echo "any_builds=false" >> $GITHUB_OUTPUT
8080 fi
8181
82-
8382 - name : Check if the `pythonbuild` crate changed
8483 id : check-pythonbuild
85- shell : bash
84+ env :
85+ BASE_REF : ${{ github.event.pull_request.base.ref || 'main' }}
8686 run : |
87- if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
87+ merge_base=$(git merge-base HEAD "origin/${BASE_REF}")
88+ if git diff --quiet "${merge_base}...HEAD" -- ':src/*.rs'; then
8889 echo "changed=false" >> "$GITHUB_OUTPUT"
8990 else
9091 echo "changed=true" >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments