Skip to content

[Github] Simplify checkout in docs test workflow #132975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

boomanaiden154
Copy link
Contributor

@boomanaiden154 boomanaiden154 commented Mar 25, 2025

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.

@boomanaiden154 boomanaiden154 force-pushed the simplify-docs-check-cloning branch 8 times, most recently from 8a38c9a to 01a4ceb Compare March 26, 2025 00:25
@boomanaiden154 boomanaiden154 force-pushed the simplify-docs-check-cloning branch from 01a4ceb to db54f0a Compare March 26, 2025 00:30
@boomanaiden154 boomanaiden154 requested a review from tstellar March 26, 2025 00:34
@boomanaiden154 boomanaiden154 marked this pull request as ready for review March 26, 2025 00:35
@llvmbot
Copy link
Member

llvmbot commented Mar 26, 2025

@llvm/pr-subscribers-github-workflow

Author: Aiden Grossman (boomanaiden154)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/132975.diff

1 Files Affected:

  • (modified) .github/workflows/docs.yml (+5-12)
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index b4e997de84679..0692633b71a54 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -54,19 +54,17 @@ jobs:
     runs-on: ubuntu-24.04
     if: github.repository == 'llvm/llvm-project'
     steps:
-      # Don't fetch before checking for file changes to force the file changes
-      # action to use the Github API in pull requests. If it's a push to a
-      # branch we can't use the Github API to get the diff, so we need to have
-      # a local checkout beforehand.
-      - name: Fetch LLVM sources (Push)
-        if: ${{ github.event_name == 'push' }}
+      - name: Fetch LLVM sources
         uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
         with:
-          fetch-depth: 1
+          fetch-depth: 2
       - name: Get subprojects that have doc changes
         id: docs-changed-subprojects
         uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
         with:
+          skip_initial_fetch: true
+          base_sha: 'HEAD~1'
+          sha: 'HEAD'
           files_yaml: |
             llvm:
               - 'llvm/docs/**'
@@ -96,11 +94,6 @@ jobs:
               - 'flang/include/flang/Optimizer/Dialect/FIROps.td'
             workflow:
               - '.github/workflows/docs.yml'
-      - name: Fetch LLVM sources (PR)
-        if: ${{ github.event_name == 'pull_request' }}
-        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-        with:
-          fetch-depth: 1
       - name: Setup Python env
         uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
         with:

@boomanaiden154 boomanaiden154 merged commit 2d14797 into llvm:main Mar 26, 2025
13 checks passed
@boomanaiden154 boomanaiden154 deleted the simplify-docs-check-cloning branch March 26, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants