Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/clang-diff-format.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
name: Clang Diff Format Check

on:
pull_request:
pull_request_target:
branches:
- develop
jobs:
ClangFormat:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
Comment thread
coderabbitai[bot] marked this conversation as resolved.
steps:
- name: Checkout
- name: Checkout base branch
uses: actions/checkout@v6
- name: Fetch git
run: git fetch --no-tags -fu origin develop:develop
with:
fetch-depth: 50
- name: Fetch PR head
run: git fetch --no-tags -f origin ${{ github.event.pull_request.head.sha }}
- name: Run Clang-Format-Diff.py
id: clang-format
run: |
git diff -U0 origin/develop -- $(git ls-files -- $(cat test/util/data/non-backported.txt)) | ./contrib/devtools/clang-format-diff.py -p1 > diff_output.txt
git diff -U0 HEAD...${{ github.event.pull_request.head.sha }} -- $(cat test/util/data/non-backported.txt) | ./contrib/devtools/clang-format-diff.py -p1 > diff_output.txt
Comment thread
UdjinM6 marked this conversation as resolved.
if [ -s diff_output.txt ]; then
echo "::warning::Clang format differences found. See PR comment for details."
echo "has_diff=true" >> "$GITHUB_OUTPUT"
Expand Down
Loading