Skip to content

Commit a59fe86

Browse files
committed
feat(linter): add mega linter
1 parent cccabd2 commit a59fe86

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

.github/workflows/mega-linter.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: MegaLinter
22

3+
env:
4+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5+
APPLY_FIXES: all
6+
APPLY_FIXES_EVENT: commit
7+
APPLY_FIXES_MODE: commit
8+
39
on:
410
push:
511

@@ -16,17 +22,14 @@ jobs:
1622
uses: actions/checkout@v4
1723

1824
- name: Run Mega-Linter
25+
id: megalinter
1926
uses: oxsecurity/megalinter@v8
20-
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
APPLY_FIXES: all
23-
APPLY_FIXES_EVENT: all
24-
APPLY_FIXES_MODE: commit
2527

26-
- name: Commit and push fixes
27-
run: |
28-
git config user.name "GitHub Action"
29-
git config user.email "action@github.com"
30-
git add .
31-
git commit -m "[MegaLinter] Apply linters fixes [skip ci]" || echo "No changes to commit"
32-
git push origin HEAD:${{ github.head_ref || github.ref_name }}
28+
- name: Commit and push applied linter fixes
29+
if: steps.megalinter.outputs.has_updated_sources == 1
30+
uses: stefanzweifel/git-auto-commit-action@v4
31+
with:
32+
branch: ${{ github.head_ref || github.ref }}
33+
commit_message: "[MegaLinter] Apply linters fixes"
34+
commit_user_name: megalinter-bot
35+
commit_user_email: nicolas.vuillamy@ox.security

0 commit comments

Comments
 (0)