mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 05:40:09 +00:00
We should diff against the base branch, not always against `main`. This allows the BuildKite pre-commit CI to work properly when we target other branches, such as `release/18.x`. (cherry picked from commit 3b762891826192ded07286852d326f9c9060f52e)
This commit is contained in:
parent
6abd792a67
commit
3173faaff1
@ -22,19 +22,20 @@ set -o pipefail
|
|||||||
|
|
||||||
# Environment variables script works with:
|
# Environment variables script works with:
|
||||||
|
|
||||||
# Fetch origin/main to have an up to date merge base for main...HEAD diff.
|
# Set by buildkite
|
||||||
git fetch origin main:main
|
: ${BUILDKITE_PULL_REQUEST_BASE_BRANCH:=}
|
||||||
|
: ${BUILDKITE_COMMIT:=}
|
||||||
|
: ${BUILDKITE_BRANCH:=}
|
||||||
|
# Fetch origin to have an up to date merge base for the diff.
|
||||||
|
git fetch origin
|
||||||
# List of files affected by this commit
|
# List of files affected by this commit
|
||||||
: ${MODIFIED_FILES:=$(git diff --name-only main...HEAD)}
|
: ${MODIFIED_FILES:=$(git diff --name-only origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}...HEAD)}
|
||||||
# Filter rules for generic windows tests
|
# Filter rules for generic windows tests
|
||||||
: ${WINDOWS_AGENTS:='{"queue": "windows"}'}
|
: ${WINDOWS_AGENTS:='{"queue": "windows"}'}
|
||||||
# Filter rules for generic linux tests
|
# Filter rules for generic linux tests
|
||||||
: ${LINUX_AGENTS:='{"queue": "linux"}'}
|
: ${LINUX_AGENTS:='{"queue": "linux"}'}
|
||||||
# Service agents, for interacting with Phabricator.
|
# Service agents, for interacting with Phabricator.
|
||||||
: ${SERVICE_AGENTS:='{"queue": "service"}'}
|
: ${SERVICE_AGENTS:='{"queue": "service"}'}
|
||||||
# Set by buildkite
|
|
||||||
: ${BUILDKITE_COMMIT:=}
|
|
||||||
: ${BUILDKITE_BRANCH:=}
|
|
||||||
|
|
||||||
reviewID="$(git log --format=%B -n 1 | sed -nE 's/^Review-ID:[[:space:]]*(.+)$/\1/p')"
|
reviewID="$(git log --format=%B -n 1 | sed -nE 's/^Review-ID:[[:space:]]*(.+)$/\1/p')"
|
||||||
if [[ "${reviewID}" != "" ]]; then
|
if [[ "${reviewID}" != "" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user