Skip to content

Fix merge-base calculation for change determination #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ jobs:

- name: Check if the `pythonbuild` crate changed
id: check-pythonbuild
env:
BASE_REF: ${{ github.event.pull_request.base.ref || 'main' }}
run: |
if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
merge_base=$(git merge-base HEAD "origin/${BASE_REF}")
if git diff --quiet "${merge_base}...HEAD" -- ':src/*.rs'; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi


build-0:
needs:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ jobs:

- name: Check if the `pythonbuild` crate changed
id: check-pythonbuild
env:
BASE_REF: ${{ github.event.pull_request.base.ref || 'main' }}
run: |
if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
merge_base=$(git merge-base HEAD "origin/${BASE_REF}")
if git diff --quiet "${merge_base}...HEAD" -- ':src/*.rs'; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

build:
needs:
- generate-matrix
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ jobs:
echo "any_builds=false" >> $GITHUB_OUTPUT
fi


- name: Check if the `pythonbuild` crate changed
id: check-pythonbuild
shell: bash
env:
BASE_REF: ${{ github.event.pull_request.base.ref || 'main' }}
run: |
if git diff --quiet ${{ github.event.pull_request.base.sha || 'origin/main' }}...HEAD -- ':src/*.rs'; then
merge_base=$(git merge-base HEAD "origin/${BASE_REF}")
if git diff --quiet "${merge_base}...HEAD" -- ':src/*.rs'; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
Expand Down