ci: Use GITHUB_BASE_REF over hard-coded master

This commit is contained in:
MarcoFalke 2025-04-04 10:48:58 +02:00
parent fa0d0be05c
commit fa10a1ded5
No known key found for this signature in database

View file

@ -72,7 +72,7 @@ jobs:
fi fi
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV" echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV"
- run: | - run: |
git fetch origin master git fetch origin "${GITHUB_BASE_REF}"
git config user.email "ci@example.com" git config user.email "ci@example.com"
git config user.name "CI" git config user.name "CI"
- run: | - run: |
@ -81,7 +81,7 @@ jobs:
- name: Compile and run tests - name: Compile and run tests
run: | run: |
# Run tests on commits after the last merge commit and before the PR head commit # Run tests on commits after the last merge commit and before the PR head commit
git rebase --exec "git merge --no-commit origin/master && ./.github/ci-test-each-commit-exec.sh && git reset --hard" ${{ env.TEST_BASE }} git rebase --exec "git merge --no-commit origin/${GITHUB_BASE_REF} && ./.github/ci-test-each-commit-exec.sh && git reset --hard" ${{ env.TEST_BASE }}
macos-native-arm64: macos-native-arm64:
name: ${{ matrix.job-name }} name: ${{ matrix.job-name }}