summaryrefslogtreecommitdiff
path: root/.github/workflows/docs.yml
diff options
context:
space:
mode:
authorAiden Grossman <agrossman154@yahoo.com>2023-10-23 22:09:02 -0700
committerAiden Grossman <agrossman154@yahoo.com>2023-10-23 22:09:02 -0700
commit099ce256633fc1f443c188b9c3a8a22d8632dcf9 (patch)
tree2800bfda17af8875a95de19b4128123fc516bf5b /.github/workflows/docs.yml
parent368a39882d286c31975792f27e52e891e5a58ab9 (diff)
[Github] Fetch before files changed action on push in docs action
My previous commit 397f1ce9efb4eea1ee10fe4833f733b8c7abd878 switched up the docs github action to use the GH API for pull requests. However, this breaks the action when pushing to a branch as the Github API can't provide diffs for commits. This patch fixes that by creating a local checkout beforehand on push events for determining the changed files.
Diffstat (limited to '.github/workflows/docs.yml')
-rw-r--r--.github/workflows/docs.yml12
1 files changed, 11 insertions, 1 deletions
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 0f2da75a6844..70b0a29b871e 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -33,6 +33,15 @@ jobs:
name: "Test documentation build"
runs-on: ubuntu-latest
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' }}
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 1
- name: Get subprojects that have doc changes
id: docs-changed-subprojects
uses: tj-actions/changed-files@v39
@@ -50,7 +59,8 @@ jobs:
- 'libunwind/docs/**'
libcxx:
- 'libcxx/docs/**'
- - name: Fetch LLVM sources
+ - name: Fetch LLVM sources (PR)
+ if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v4
with:
fetch-depth: 1