1
1
---
2
2
# MegaLinter GitHub Action configuration file
3
3
# More info at https://megalinter.io
4
- # All variables described in https://megalinter.io/latest/config-file /
4
+ # All variables described in https://megalinter.io/latest/configuration /
5
5
6
6
name : MegaLinter
7
7
on :
@@ -21,16 +21,14 @@ jobs:
21
21
megalinter :
22
22
name : MegaLinter
23
23
runs-on : ubuntu-latest
24
- env :
25
- # Grafana Dashboard Connections - GitHub Organization secrets
26
- API_REPORTER : true
27
- API_REPORTER_URL : ${{ secrets.API_REPORTER_URL }}
28
- API_REPORTER_BASIC_AUTH_USERNAME : ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
29
- API_REPORTER_BASIC_AUTH_PASSWORD : ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
30
- API_REPORTER_METRICS_URL : ${{ secrets.API_REPORTER_METRICS_URL }}
31
- API_REPORTER_METRICS_BASIC_AUTH_USERNAME : ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
32
- API_REPORTER_METRICS_BASIC_AUTH_PASSWORD : ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
33
- API_REPORTER_DEBUG : true
24
+
25
+ # Give the default GITHUB_TOKEN write permission to commit and push, comment
26
+ # issues, and post new Pull Requests; remove the ones you do not need
27
+ permissions :
28
+ contents : write
29
+ issues : write
30
+ pull-requests : write
31
+
34
32
steps :
35
33
- run : echo "🚀 Job automatically triggered by ${{ github.event_name }}"
36
34
- run : echo "🐧 Job running on ${{ runner.os }} server"
@@ -40,27 +38,46 @@ jobs:
40
38
- name : Checkout Code
41
39
uses : actions/checkout@v4
42
40
with :
43
- token : " ${{ secrets.PAT || secrets.GITHUB_TOKEN }}"
44
41
fetch-depth : 0
45
- - run : echo "🐙 ${{ github.repository }} repository was cloned to the runner."
42
+ sparse-checkout : |
43
+ docs
44
+ overrides
45
+ .github
46
+ - run : echo "🐙 Sparse Checkout of ${{ github.repository }} repository to the CI runner."
46
47
47
48
# MegaLinter Configuration
48
49
- name : MegaLinter Run
49
- id : ml
50
- # # latest release of major version
51
50
uses :
oxsecurity/megalinter/flavors/[email protected]
51
+ id : ml
52
52
env :
53
- # ADD CUSTOM ENV VARIABLES OR DEFINE IN MEGALINTER_CONFIG file
54
- MEGALINTER_CONFIG : .github/config/megalinter.yaml
55
53
56
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}" # report individual linter status
57
- # Validate all source when push on main, else just the git diff with live.
54
+ # Validate the git diff against default branch.
58
55
VALIDATE_ALL_CODEBASE : >-
59
56
${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}}
60
57
58
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}" # report individual linter status
59
+
60
+ # ADD CUSTOM ENV VARIABLES OR DEFINE IN MEGALINTER_CONFIG file
61
+ MEGALINTER_CONFIG : .github/config/megalinter.yaml
62
+
63
+ # Grafana Dashboard Connections - GitHub Organization secrets
64
+ API_REPORTER : true
65
+ API_REPORTER_URL : ${{ secrets.API_REPORTER_URL }}
66
+ API_REPORTER_BASIC_AUTH_USERNAME : ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
67
+ API_REPORTER_BASIC_AUTH_PASSWORD : ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
68
+ API_REPORTER_BEARER_TOKEN : ${{ secrets.API_REPORTER_BEARER_PASSWORD }}
69
+ API_REPORTER_METRICS_URL : ${{ secrets.API_REPORTER_METRICS_URL }}
70
+ API_REPORTER_METRICS_BASIC_AUTH_USERNAME : ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
71
+ API_REPORTER_METRICS_BASIC_AUTH_PASSWORD : ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
72
+ API_REPORTER_METRICS_BEARER_TOKEN : ${{ secrets.API_REPORTER_METRICS_BEARER_PASSWORD }}
73
+ API_REPORTER_DEBUG : false
74
+
75
+ # Logging
76
+ # LOG_LEVEL: DEBUG
77
+
61
78
# Upload MegaLinter artifacts
62
79
- name : Archive production artifacts
63
- if : ${{ success() }} || ${{ failure() }}
80
+ if : success() || failure()
64
81
uses : actions/upload-artifact@v4
65
82
with :
66
83
name : MegaLinter reports
0 commit comments