-
Notifications
You must be signed in to change notification settings - Fork 4
30 lines (28 loc) · 936 Bytes
/
format.yml
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
29
30
name: "Format sourcecode"
# run on pull requests to develop
on:
pull_request:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# check out HEAD on the branch
ref: ${{ github.head_ref }}
# make sure the parent commit is grabbed as well, because
# that's what will get formatted (i.e. the most recent commit)
fetch-depth: 2
# format the latest commit
- uses: purduesigbots/clang-format-action@1
# use one of clang-format's supported styles or leave this out to use the style in your .clang-format file
with:
style: file
# commit the changes (if there are any)
- name: Commit changes
uses: stefanzweifel/[email protected]
with:
commit_message: 🎨 apply clang-format changes
branch: ${{ github.head_ref }}