Skip to content

Commit

Permalink
test fix pr formating CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ipa-vsp committed Apr 23, 2024
1 parent db3a93d commit 71b8b2b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/fix-pr-formatting.yml
@@ -0,0 +1,37 @@
# This is a format job. Pre-commit has a first-party GitHub action, so we use
# that: https://github.com/pre-commit/action

name: PR fix formatting

on:
workflow_dispatch:
pull_request:

jobs:
pre-commit:
name: Format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for all branches and tags, which might be needed when pushing commits.
token: ${{ secrets.BOT_PAT }}
ref: ${{ github.head_ref }}
- uses: actions/setup-python@v5
with:
python-version: 3.10.6
- name: Install system hooks
run: sudo apt update && sudo apt install -qq clang-format-14 cppcheck
- name: Run pre-commit checks
uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --hook-stage manual
continue-on-error: true
- name: Commit and push if changed
run: |
git diff
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add -u
git commit -m "Automated code fixes by pre-commit." || echo "No changes to commit"
git push origin HEAD:${{ github.head_ref }}

0 comments on commit 71b8b2b

Please sign in to comment.