66
77name : MegaLinter
88
9+ run-name : ${{ github.workflow }} @ ${{ github.ref }}
10+
911on :
1012 push :
1113 branches-ignore :
12- - assets**
14+ - assets
15+ - dist
1316 - gh-pages
1417 pull_request :
1518 workflow_dispatch :
1619
20+ concurrency :
21+ group : ${{ github.workflow }} @ ${{ github.ref }}
22+ cancel-in-progress : true
23+
1724jobs :
18- delete-cancelled-runs :
19- name : Delete Cancelled Runs
25+ pre :
26+ name : Pre
2027 permissions :
2128 actions : write
22- runs-on : " ubuntu-latest"
23- steps :
24- - id : workflow
25- name : Get Workflow File
26- run : |-
27- file="${GITHUB_WORKFLOW_REF%@*}"
28- file="$(basename -- "$file")"
29- printf "file=%q\n" "$file" >> "$GITHUB_OUTPUT"
30- - uses : MercuryTechnologies/delete-cancelled-runs@1.0.0
31- with :
32- workflow-file : ${{ steps.workflow.outputs.file }}
33- github-token : ${{ github.token }}
34-
35- skip-duplicate-actions :
36- name : Skip Duplicate Actions
3729 runs-on : ubuntu-latest
3830 outputs :
39- should-skip : ${{ steps.skip .outputs.should_skip }}
31+ should-skip : ${{ steps.pre .outputs.should-skip }}
4032 steps :
41- - id : skip
33+ - id : pre
4234 name : Skip Duplicate Actions
43- uses : fkirc/skip-duplicate- actions@v5
35+ uses : liblaf/ actions-ts/pre@dist
4436 with :
45- concurrent_skipping : same_content_newer
37+ cancel-others : true
4638
4739 mega-linter :
4840 name : MegaLinter
4941 permissions :
50- contents : write # commit fix
51- issues : write # ref: <https://megalinter.io/latest/reporters/GitHubCommentReporter/>
52- pull-requests : write # ref: <https://megalinter.io/latest/reporters/GitHubCommentReporter/>
42+ contents : write
43+ issues : write
44+ pull-requests : write
5345 needs :
54- - skip-duplicate-actions
55- if : needs.skip-duplicate-actions .outputs.should-skip != 'true'
46+ - pre
47+ if : needs.pre .outputs.should-skip != 'true'
5648 runs-on : ubuntu-latest
57- concurrency :
58- group : ${{ github.workflow }}-${{ github.ref }}-mega-linter
59- cancel-in-progress : true
6049 steps :
6150 - id : auth
62- name : Auth App
63- uses : liblaf/actions/auth-app@main
51+ name : Authenticate
52+ uses : liblaf/actions-ts/authenticate@dist
6453 with :
6554 app-id : ${{ secrets.GH_APP_ID }}
6655 private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
@@ -69,15 +58,42 @@ jobs:
6958 with :
7059 ref : ${{ github.head_ref || github.ref }}
7160 token : ${{ steps.auth.outputs.token }}
72- - name : MegaLinter
73- uses : liblaf/actions/mega-linter@main
61+ - id : lint
62+ name : MegaLinter
63+ uses : liblaf/actions-ts/mega-linter@dist
64+ with :
65+ token : ${{ steps.auth.outputs.token }}
66+ - if : success() || failure()
67+ name : Upload Reports
68+ uses : actions/upload-artifact@v4
69+ with :
70+ name : mega-linter-reports
71+ path : |-
72+ mega-linter.log
73+ megalinter-reports/
74+ include-hidden-files : true
75+ - if : success() || failure()
76+ name : Add Job Summary
77+ run : cat 'megalinter-reports/megalinter-report.md' >> "$GITHUB_STEP_SUMMARY"
78+ - if : github.ref == 'refs/heads/main' && steps.lint.outputs.has-updated-sources > 0
79+ name : Create PR with Applied Fixes
80+ uses : peter-evans/create-pull-request@v7
7481 with :
7582 token : ${{ steps.auth.outputs.token }}
76- - name : Remove MegaLinter Reports
77- run : sudo rm --force --recursive "mega-linter.log" "megalinter-reports/"
78- - name : Commit
79- uses : liblaf/actions/commit@main
83+ commit-message : " chore(mega-linter): apply linters automatic fixes"
84+ committer : ${{ steps.auth.outputs.committer }}
85+ author : ${{ steps.auth.outputs.author }}
86+ branch : mega-linter-fix/${{ github.ref_name }}
87+ sign-commits : true
88+ title : " chore(mega-linter): apply linters automatic fixes"
89+ body-path : megalinter-reports/megalinter-report.md
90+ labels : automerge
91+ assignees : ${{ github.repository_owner }}
92+ reviewers : ${{ github.repository_owner }}
93+ - if : github.ref != 'refs/heads/main' && steps.lint.outputs.has-updated-sources > 0
94+ name : Commit and Push Applied Linter Fixes
95+ uses : liblaf/actions-ts/commit@dist
8096 with :
8197 add-options : --verbose --update
82- message : " chore(mega-linter): apply linter fixes"
98+ message : " chore(mega-linter): apply linters automatic fixes"
8399 token : ${{ steps.auth.outputs.token }}
0 commit comments