1
- ---
2
1
name : MegaLinter
3
2
4
3
on :
@@ -17,44 +16,17 @@ jobs:
17
16
- name : Checkout Code
18
17
uses : actions/checkout@v3
19
18
with :
20
- token : ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
21
19
fetch-depth : 0
22
20
23
21
- name : MegaLinter
24
- id : ml
25
- uses : megalinter/megalinter@v6
22
+ uses :
megalinter/[email protected]
26
23
env :
27
24
BASH_SHFMT_ARGUMENTS : --indent 2 --space-redirects
28
25
DISABLE_LINTERS : COPYPASTE_JSCPD,JSON_PRETTIER,MARKDOWN_MARKDOWN_LINK_CHECK,REPOSITORY_DEVSKIM,REPOSITORY_SEMGREP,SPELL_CSPELL,SPELL_PROSELINT,YAML_V8R
29
26
FILTER_REGEX_EXCLUDE : ' (.*\.ps1|CHANGELOG.md)'
30
27
FORMATTERS_DISABLE_ERRORS : false
28
+ GITHUB_COMMENT_REPORTER : false
29
+ GITHUB_STATUS_REPORTER : true
31
30
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32
31
PRINT_ALPACA : false
33
32
VALIDATE_ALL_CODEBASE : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
34
-
35
- - name : Create Pull Request with applied fixes
36
- id : cpr
37
- if : steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
38
- uses : peter-evans/create-pull-request@v4
39
- with :
40
- token : ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
41
- commit-message : " [MegaLinter] Apply linters automatic fixes"
42
- title : " [MegaLinter] Apply linters automatic fixes"
43
- labels : bot
44
-
45
- - name : Create PR output
46
- if : steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
47
- run : |
48
- echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
49
- echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
50
-
51
- - name : Prepare commit
52
- if : steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
53
- run : sudo chown -Rc $UID .git/
54
-
55
- - name : Commit and push applied linter fixes
56
- if : steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
57
- uses : stefanzweifel/git-auto-commit-action@v4
58
- with :
59
- branch : ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
60
- commit_message : " [MegaLinter] Apply linters fixes"
0 commit comments