Skip to content

Commit 75435ca

Browse files
committed
Auto execute clang-format lint for per pull-request
1 parent 2e587ea commit 75435ca

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/clang-format.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: clang-format
22

33
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
46
workflow_dispatch:
57
inputs:
68
commit_changes:
@@ -12,26 +14,28 @@ on:
1214
required: false
1315

1416
jobs:
15-
build:
17+
clang-format-lint:
1618
runs-on: ubuntu-latest
1719

1820
steps:
1921
- uses: actions/checkout@v4
2022

2123
- name: Run clang-format lint
22-
uses: DoozyX/clang-format-lint-action@v0.18
24+
uses: DoozyX/clang-format-lint-action@v0.20
2325
with:
24-
source: './core ./extensions ./tests ./templates'
26+
source: './axmol ./extensions ./tests ./templates'
2527
exclude: './thidrparty ./extensions/fairygui ./extensions/Live2D ./extensions/Effekseer ./extensions/scripting/lua-bindings/auto ./extensions/spine ./tests/fairygui-tests ./extensions/**/*_generated.h'
2628
extensions: 'h,cpp,c,mm'
2729
clangFormatVersion: 19
2830
inplace: True
2931
- name: Commit clang-format changes
30-
if: ${{ github.event.inputs.commit_changes == 'true' }}
32+
if: ${{ github.event.inputs.commit_changes == 'true' || github.event_name == 'pull_request' }}
3133
uses: EndBug/add-and-commit@v9
3234
with:
35+
default_author: github_actions
3336
committer_name: GitHub Actions
3437
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
3538
message: 'Committing clang-format changes'
39+
new_branch: ${{ github.head_ref }}
3640
env:
3741
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)