[llvm] [Github] Force changed files step to use GH API for code formatting (PR #69766)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 20 14:25:30 PDT 2023
https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/69766
>From f44998a0ee126e3cfcd881d3351deb41c958f77b Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Fri, 20 Oct 2023 14:23:06 -0700
Subject: [PATCH] [Github] Fetch all commits in PR for code formatting checks
This patch ensures that all commits from a PR are fetched before running
the rest of the job. This allows the job to scale to any number of
commits per PR. In addition, this significantly reduces the time taken
in the files-changed step where the job would itself try to unshallow
the clone, but do so in some inefficient way. That step which previously
took ~10 minutes now takes 3 seconds after this patch.
---
.github/workflows/pr-code-format.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 3a91ffb0b1ad9a7..8ca27c2f6363b16 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -10,14 +10,13 @@ jobs:
- name: Fetch LLVM sources
uses: actions/checkout at v4
with:
- fetch-depth: 2
+ fetch-depth: ${{ github.event.pull_request.commits }}
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files at v39
with:
separator: ","
- fetch_depth: 100 # Fetches only the last 10 commits
- name: "Listed files"
run: |
More information about the llvm-commits
mailing list