Skip to content

Commit

Permalink
Merge branch 'user/micnasr/format-check' of github.com:macformula/rac…
Browse files Browse the repository at this point in the history
…ecar into user/micnasr/format-check
  • Loading branch information
Micnasr committed Mar 26, 2024
2 parents 21a204a + f98b433 commit 711ea6c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/pr-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Clang Format Check

on:
pull_request:
branches:
Expand All @@ -13,14 +11,23 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up clang-format
run: sudo apt-get install clang-format

- name: Fetch main branch
run: git fetch origin main:main

- name: Get commit ID of main branch
run: |
MAIN_COMMIT=$(git rev-parse origin/main)
echo "Commit ID of main branch: $MAIN_COMMIT"
- name: Check code formatting
run: |
git clang-format --style=firmware/.clang-format --diff HEAD -- '*.cpp' '*.h'
git clang-format --style=firmware/.clang-format --diff $MAIN_COMMIT..HEAD '*.cpp' '*.h'
- name: Check for changes
id: check_changes
Expand Down

0 comments on commit 711ea6c

Please sign in to comment.