[llvm] [Github] Use API to fetch PR diff for docs action (PR #70001)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 23 20:20:23 PDT 2023
https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/70001
People are currently running into issues where the files-changed step isn't able to find the merge base. This seems to happen more often on very out of date branches. This patch side steps the issue by just fetching the diff from the GH API.
>From d43680a10c3579eb94c0c2f3b2ad1ae5d7557adf Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Mon, 23 Oct 2023 20:16:30 -0700
Subject: [PATCH] [Github] Use API to fetch PR diff for docs action
People are currently running into issues where the files-changed step
isn't able to find the merge base. This seems to happen more often on
very out of date branches. This patch side steps the issue by just
fetching the diff from the GH API.
---
.github/workflows/docs.yml | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 57cb9ecf2ca1fcd..c31396822749daf 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -29,22 +29,6 @@ jobs:
name: "Test documentation build"
runs-on: ubuntu-latest
steps:
- # Fetch all the commits in a pull request + 1 so that the
- # docs-changed-subprojects step won't pull them in itself in an extremely
- # slow manner.
- - name: Calculate number of commits to fetch (PR)
- if: ${{ github.event_name == 'pull_request' }}
- run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- - name: Fetch LLVM sources (PR)
- if: ${{ github.event_name == 'pull_request' }}
- uses: actions/checkout at v4
- with:
- fetch-depth: ${{ env.PR_FETCH_DEPTH }}
- - name: Fetch LLVM sources (push)
- if: ${{ github.event_name == 'push' }}
- uses: actions/checkout at v4
- with:
- fetch-depth: 1
- name: Get subprojects that have doc changes
id: docs-changed-subprojects
uses: tj-actions/changed-files at v39
@@ -58,6 +42,10 @@ jobs:
- 'clang-tools-extra/docs/**'
lldb:
- 'lldb/docs/**'
+ - name: Fetch LLVM sources
+ uses: actions/checkout at v4
+ with:
+ fetch-depth: 1
- name: Setup Python env
uses: actions/setup-python at v4
with:
More information about the llvm-commits
mailing list