Skip to content

Commit 6250afe

Browse files
[Github] Fetch an additional commit for docs CI on PRs
There still seem to be issues with the files changed step taking a significant amount of time on PRs. This seems to be occurring on PRs with one commit and not on PRs with more than one commit which is why I didn't catch this nuance before. Either way, fetching an additional commit seems to fix the issue. Requires a little bit of hackiness due to the fact that you can't do math in the github actions variables. Will be monitoring this over the next little bit to see if this actually fixes the problem. CI stuff is annoying sometimes.
1 parent 196a09f commit 6250afe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ jobs:
2929
name: "Test documentation build"
3030
runs-on: ubuntu-latest
3131
steps:
32-
# Fetch all the commits in a pull request so that the
32+
# Fetch all the commits in a pull request + 1 so that the
3333
# docs-changed-subprojects step won't pull them in itself in an extremely
3434
# slow manner.
35-
- name: Fetch LLVM sources (PR)
35+
- name: Calculate number of commits to fetch (PR)
3636
if: ${{ github.event_name == 'pull_request' }}
37+
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
38+
- name: Fetch LLVM sources (PR)
39+
if: ${{ github.event_name == 'pull_request' }}
3740
uses: actions/checkout@v4
3841
with:
39-
fetch-depth: ${{ github.event.pull_request.commits }}
42+
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
4043
- name: Fetch LLVM sources (push)
4144
if: ${{ github.event_name == 'push' }}
4245
uses: actions/checkout@v4

0 commit comments

Comments
 (0)