Skip to content

Commit 8a38c9a

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

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,16 @@ 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
7067
files_yaml: |
7168
llvm:
7269
- 'llvm/docs/**'
@@ -96,11 +93,6 @@ jobs:
9693
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
9794
workflow:
9895
- '.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
10496
- name: Setup Python env
10597
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
10698
with:
@@ -111,6 +103,8 @@ jobs:
111103
run: pip install -r llvm/docs/requirements-hashed.txt
112104
- name: Install system dependencies
113105
run: |
106+
echo "${{ toJson(steps.docs-changed-subprojects.outputs) }}"
107+
git log
114108
sudo apt-get update
115109
# swig and graphviz are lldb specific dependencies
116110
sudo apt-get install -y cmake ninja-build swig graphviz

0 commit comments

Comments
 (0)