Skip to content

Commit 3d133ff

Browse files
committed
[GitHub] ADD ci-astyle workflow
1 parent bf25fdb commit 3d133ff

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/ci-astyle.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ci-astyle
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened]
7+
issue_comment:
8+
types: [created]
9+
10+
jobs:
11+
run:
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
16+
ISSUE_BODY: "${{ github.event.issue.body }}"
17+
18+
steps:
19+
- name: Parse comment
20+
id: check
21+
if: github.event.issue.pull_request
22+
uses: SquisEat/pull-request-comment-trigger@1.0.1
23+
with:
24+
trigger: '[ci-astyle]'
25+
reaction: rocket
26+
27+
- name: Install astyle
28+
if: steps.check.outputs.triggered == 'true'
29+
run: sudo apt-get install -y astyle
30+
31+
- name: Checkout code
32+
if: steps.check.outputs.triggered == 'true'
33+
uses: actions/checkout@v2
34+
35+
- name: Get all changed files
36+
if: steps.check.outputs.triggered == 'true'
37+
uses: jitterbit/get-changed-files@v1
38+
39+
- name: Run Astyle
40+
id: files
41+
if: steps.check.outputs.triggered == 'true'
42+
run: |
43+
astyle --project=tools/astyle/sofa.astyle ${{ steps.files.outputs.all }}
44+
45+
- name: Commit changes
46+
if: steps.check.outputs.triggered == 'true'
47+
uses: stefanzweifel/git-auto-commit-action@v2.3.0
48+
with:
49+
commit_message: CLEAN style (auto-commit by ci-astyle.yml)
50+
branch: ${{ github.head_ref }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+

0 commit comments

Comments
 (0)