Skip to content

Commit 8ca9884

Browse files
Update code-style.yml
1 parent e1b81f5 commit 8ca9884

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/code-style.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ jobs:
1212
- name: Checkout code
1313
uses: actions/checkout@v4
1414

15-
- name: Detect job name
16-
id: detect
17-
run: |
18-
[[ ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} ]] && NAME="Fix" || NAME="Check"
19-
20-
echo "name=${NAME}" >> $GITHUB_OUTPUT
15+
- name: Check the code style
16+
uses: TheDragonCode/codestyler@v3
17+
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/main' }}
2118

22-
- name: ${{ steps.detect.outputs.name }} the code style
19+
- name: Fix the code style
2320
uses: TheDragonCode/codestyler@v3
21+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
2422
with:
2523
github_token: ${{ secrets.COMPOSER_TOKEN }}
26-
fix: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
24+
fix: true

0 commit comments

Comments
 (0)