Skip to content

Commit

Permalink
Explicitly specify the PR ref
Browse files Browse the repository at this point in the history
pull_request_target only gets the base ref not the branch so the diff
between base ref and head is always empty.
  • Loading branch information
llvm-beanz committed Sep 20, 2023
1 parent 314d2ff commit 14c5dc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/clang-format-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
echo Comparing $GITHUB_BASE_REF vs HEAD
git diff -U0 --no-color origin/$GITHUB_BASE_REF..HEAD | clang-format-diff -p1 | tee format.diff
git fetch origin refs/pull/$PR_NUMBER/head
git diff -U0 --no-color origin/$GITHUB_BASE_REF..refs/pull/$PR_NUMBER/head | clang-format-diff -p1 | tee format.diff
if [ -s "format.diff" ]
then
echo PR contains clang-format violations. First 50 lines of the diff: >> message.txt
Expand Down

0 comments on commit 14c5dc3

Please sign in to comment.