Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-commit clang format #1464

Merged
merged 1 commit into from
Sep 18, 2024
Merged
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
32 changes: 26 additions & 6 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Format
name: Apply clang-format
on:
push:
branches:
Expand All @@ -9,9 +9,29 @@ jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: extractions/setup-just@v2
with:
- name: Install just
uses: extractions/setup-just@v2
with:
just-version: 1.26.0
- uses: actions/checkout@v4
- name: run format check on the C++
run: just install-denv init format-cpp --verbose -Werror --dry-run

- uses: actions/checkout@v4

- name: Pull latest changes
run: |
git fetch origin ${GITHUB_HEAD_REF}
git checkout ${GITHUB_HEAD_REF}
git pull origin ${GITHUB_HEAD_REF}

- name: Run format check on the C++
run: just install-denv init format-cpp

- name: Set up git user as the bot
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

- name: Auto-commit the changes
run: |
git add .
git commit -m "Apply clang-format" || echo "No changes to commit"
git push origin HEAD:${GITHUB_HEAD_REF}