Skip to content

Commit

Permalink
Created format.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wins1ey committed Jun 2, 2024
1 parent 30f6061 commit 71e2aa6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on: [pull_request]

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Format files
run: |
clang-format -i $(find src -name '*.c' -or -name '*.h')
- name: Check for changes
run: |
changed_files=$(git diff --name-only)
if [ -n "$changed_files" ]; then
echo "The following files require formatting:"
echo "$changed_files"
echo "Run 'make format' and commit the changes."
exit 1
fi

0 comments on commit 71e2aa6

Please sign in to comment.