aboutsummaryrefslogtreecommitdiff
path: root/.ci
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2023-09-29 10:24:48 -0400
committerGitHub <noreply@github.com>2023-09-29 10:24:48 -0400
commitec9d80ec43f5761a34c4a785c67d9e7d21ec8bda (patch)
tree1f4cb51717a7a1fe76f1e8cecc1e7cde17f27d68 /.ci
parent2cac95ba2bd91adb4dad552993d589770ec6996d (diff)
downloadllvm-ec9d80ec43f5761a34c4a785c67d9e7d21ec8bda.zip
llvm-ec9d80ec43f5761a34c4a785c67d9e7d21ec8bda.tar.gz
llvm-ec9d80ec43f5761a34c4a785c67d9e7d21ec8bda.tar.bz2
[ci] Diff against main when determining what files have changed for pre-commit CI (#67743)
Since we moved to Github PRs, the workflow has changed a bit and folks often merge `main` back into their PR branch. This is fine, except the previous way of determining modified files for pre-commit CI would use the content modified just in the latest commit, whatever it is. This means that in case someone merged main back into their PR branch, we'd think that the files in the merge commit were modified by the PR, and we'd spuriously trigger a CI run. This should fix this issue. The downside is that the merge target is hardcoded to `main`, which might not always be what we want. I still think this is an improvement over the status quo.
Diffstat (limited to '.ci')
-rwxr-xr-x.ci/generate-buildkite-pipeline-premerge2
1 files changed, 1 insertions, 1 deletions
diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge
index e389df4..f45a4d8 100755
--- a/.ci/generate-buildkite-pipeline-premerge
+++ b/.ci/generate-buildkite-pipeline-premerge
@@ -22,7 +22,7 @@ set -o pipefail
# Environment variables script works with:
# List of files affected by this commit
-: ${MODIFIED_FILES:=$(git diff --name-only HEAD~1)}
+: ${MODIFIED_FILES:=$(git diff --name-only main...HEAD)}
# Filter rules for generic windows tests
: ${WINDOWS_AGENTS:='{"queue": "windows"}'}
# Filter rules for generic linux tests