Skip to content

Commit 2d14797

Browse files
[Github] Simplify checkout in docs test workflow (llvm#132975)
This makes things quite a bit simpler and also gets rid of some API calls. We weren't hitting any API limits, but getting rid of them leaves more quota for other things should we ever need it. This just diffs the merge commit in the pull request workflows, which gives the diff for the PR.
1 parent 86690ce commit 2d14797

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/docs.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,17 @@ jobs:
5454
runs-on: ubuntu-24.04
5555
if: github.repository == 'llvm/llvm-project'
5656
steps:
57-
# Don't fetch before checking for file changes to force the file changes
58-
# action to use the Github API in pull requests. If it's a push to a
59-
# branch we can't use the Github API to get the diff, so we need to have
60-
# a local checkout beforehand.
61-
- name: Fetch LLVM sources (Push)
62-
if: ${{ github.event_name == 'push' }}
57+
- name: Fetch LLVM sources
6358
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6459
with:
65-
fetch-depth: 1
60+
fetch-depth: 2
6661
- name: Get subprojects that have doc changes
6762
id: docs-changed-subprojects
6863
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
6964
with:
65+
skip_initial_fetch: true
66+
base_sha: 'HEAD~1'
67+
sha: 'HEAD'
7068
files_yaml: |
7169
llvm:
7270
- 'llvm/docs/**'
@@ -96,11 +94,6 @@ jobs:
9694
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
9795
workflow:
9896
- '.github/workflows/docs.yml'
99-
- name: Fetch LLVM sources (PR)
100-
if: ${{ github.event_name == 'pull_request' }}
101-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
102-
with:
103-
fetch-depth: 1
10497
- name: Setup Python env
10598
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
10699
with:

0 commit comments

Comments
 (0)