[llvm] workflows/premerge: Remove full checkout when computing macOS changes for pushes (PR #224874)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 20 08:02:41 PDT 2026
https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/224874
>From 6335b76f268fc4ceec33fcad10fe0a8afd6c64b3 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 19 Sep 2026 17:00:01 -0700
Subject: [PATCH 1/2] workflows/premerge: Remove full checkout when computing
macOS changes for pushes
We can compute the changes using the API like we do for pull requests.
---
.github/workflows/premerge.yaml | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index c6d604533f1f6..ce3ec08a47156 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -200,18 +200,11 @@ jobs:
# pushes (e.g. release branches) there is no PR to query, so we fall
# back to a git diff, which needs real history.
- name: Checkout LLVM (sparse)
- if: github.event_name == 'pull_request'
uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
sparse-checkout: .ci
sparse-checkout-cone-mode: false
- - name: Checkout LLVM
- if: github.event_name != 'pull_request'
- uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- with:
- persist-credentials: false
- fetch-depth: 2
- name: Get Changed Files
env:
GH_TOKEN: ${{ github.token }}
@@ -221,7 +214,7 @@ jobs:
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
gh api "repos/${REPO}/pulls/${PR_NUMBER}/files" --paginate --jq '.[].filename' > /tmp/changed_files.txt
else
- git diff --name-only HEAD~1...HEAD > /tmp/changed_files.txt
+ gh api "repos/${REPO}/compare/${{ github.event.before }}...${{ github.event.after }}" --paginate --jq '.files[].filename' > /tmp/changed_files.txt
fi
- name: Compute Projects
id: vars
>From 403886647e4571fbf9e1b2e86436515ea0c83024 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sun, 20 Sep 2026 08:02:20 -0700
Subject: [PATCH 2/2] Remove comment
---
.github/workflows/premerge.yaml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/.github/workflows/premerge.yaml b/.github/workflows/premerge.yaml
index ce3ec08a47156..3878153f3e698 100644
--- a/.github/workflows/premerge.yaml
+++ b/.github/workflows/premerge.yaml
@@ -195,10 +195,6 @@ jobs:
macos-runtimes: ${{ steps.vars.outputs.macos-runtimes }}
macos-runtimes-check-targets: ${{ steps.vars.outputs.macos-runtimes-check-targets }}
steps:
- # For pull requests we get the changed files from the GitHub API, so we
- # only need a sparse checkout of .ci/ to run compute_projects.py. For
- # pushes (e.g. release branches) there is no PR to query, so we fall
- # back to a git diff, which needs real history.
- name: Checkout LLVM (sparse)
uses: actions/checkout at df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
More information about the llvm-commits
mailing list