File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change 1- name : code-style
1+ name : Code Style
22
3- on :
4- push :
5- pull_request :
3+ on : [ push, pull_request ]
64
75permissions : write-all
86
97jobs :
10- check :
11- if : ${{ ! (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
12-
8+ style :
139 runs-on : ubuntu-latest
1410
1511 steps :
1612 - name : Checkout code
1713 uses : actions/checkout@v3
1814
19- - name : Checking PHP Syntax
20- uses : TheDragonCode/codestyler@v3
21-
22- fix :
23- if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
24-
25- runs-on : ubuntu-latest
15+ - name : Detect job name
16+ id : detect
17+ run : |
18+ [[ ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} ]] && NAME="Fix" || NAME="Check"
2619
27- steps :
28- - name : Checkout code
29- uses : actions/checkout@v3
20+ echo "name=${NAME}" >> $GITHUB_OUTPUT
3021
31- - name : Checking PHP Syntax
22+ - name : ${{ steps.detect.outputs.name }} the code style
3223 uses : TheDragonCode/codestyler@v3
3324 with :
3425 github_token : ${{ secrets.COMPOSER_TOKEN }}
35- fix : true
26+ fix : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
You can’t perform that action at this time.
0 commit comments