-
Notifications
You must be signed in to change notification settings - Fork 69
28 lines (26 loc) · 898 Bytes
/
check_format.yml
File metadata and controls
28 lines (26 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: "Check Clang Format"
on: [push, pull_request]
jobs:
format:
name: "Check Clang Format"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: "Install clang-format"
run: |
sudo apt-get update
sudo apt-get install clang-format
- name: "Format Codes"
run: clang-format -i src/*.cpp src/*.h src/**/*.cpp src/**/*.h src/**/**/*.cpp src/**/**/*.h src/**/*.hpp
- name: Check diff
run: git diff --exit-code HEAD
- name: Create Pull Request
if: failure()
uses: peter-evans/create-pull-request@v8
with:
commit-message: "style: format codes"
title: "Format codes for ${{ github.ref }}"
labels: "style"
assignees: "${{ github.actor }}"
reviewers: "${{ github.actor }}"
branch: "auto-pr/clang-format/${{ github.ref }}"