Skip to content

Commit 01a4ceb

Browse files
[Github] Simplify checkout in docs test workflow
1 parent 011a95c commit 01a4ceb

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

.github/workflows/docs.yml

Lines changed: 7 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:
@@ -111,6 +104,8 @@ jobs:
111104
run: pip install -r llvm/docs/requirements-hashed.txt
112105
- name: Install system dependencies
113106
run: |
107+
echo "${{ toJson(steps.docs-changed-subprojects.outputs) }}"
108+
git log
114109
sudo apt-get update
115110
# swig and graphviz are lldb specific dependencies
116111
sudo apt-get install -y cmake ninja-build swig graphviz

0 commit comments

Comments
 (0)