[llvm] [workflows] Split pr-code-format into two parts to make it more secure (PR #78216)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 15:04:35 PST 2024


================
@@ -72,9 +58,17 @@ jobs:
         # explicitly in code-format-helper.py and not have to diff starting at
         # the merge base.
         run: |
-          python ./code-format-tools/llvm/utils/git/code-format-helper.py \
+          python ./llvm/utils/git/code-format-helper.py \
+            --write-comment-to-file \
             --token ${{ secrets.GITHUB_TOKEN }} \
             --issue-number $GITHUB_PR_NUMBER \
             --start-rev $(git merge-base $START_REV $END_REV) \
----------------
boomanaiden154 wrote:

Actually, we should be fine here as long as we're checking out the same ref that we were before. As long as we're doing that, everything should work the same. It will have some quirks like not being run if there's a merge conflict even if we're not performing a merge, but that should be fine.

Eventually if we want to clean this up, it's definitely doable, but keeping the current functionality (minus running when there are merge conflicts) as it is seems fine to me.

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


More information about the llvm-commits mailing list