[llvm] [Github] Fetch all commits in PR for code formatting checks (PR #69766)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 28 18:28:39 PDT 2023


boomanaiden154 wrote:

@tstellar @tru This should be approximately ready for review at this point. There are a couple key changes made in this PR:
* Moved the changed files action to before the checkout to ensure that it grabs information from the Github API.
* Switch the checkout ref to the head of the PR rather than the base.
* Add an additional sparse LLVM checkout from the PR target ref with the files necessary to run the workflow to prevent security concerns.
* Adjust commit references to use values relative to `HEAD` rather than exact commit SHAs as there is no way to get the SHA of the first commit from the Github variables as far as I can tell.

I've tested this against a couple LLVM PRs on my fork and everything seems to be working well, including a couple cherry-picked PRs that didn't run before due to the changed-files action failing. This also significantly improves the speed of the workflow.

It's a little bit hacky doing the multiple checkouts. This can probably be alleviaated by performing the build inside a container (which would also make this faster), but I'll leave that to a future change for the moment.

https://github.com/llvm/llvm-project/pull/69766


More information about the llvm-commits mailing list