11---
22# MegaLinter GitHub Action configuration file
33# 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 /
55
66name : MegaLinter
77on :
@@ -21,16 +21,14 @@ jobs:
2121 megalinter :
2222 name : MegaLinter
2323 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+
3432 steps :
3533 - run : echo "🚀 Job automatically triggered by ${{ github.event_name }}"
3634 - run : echo "🐧 Job running on ${{ runner.os }} server"
@@ -40,27 +38,46 @@ jobs:
4038 - name : Checkout Code
4139 uses : actions/checkout@v4
4240 with :
43- token : " ${{ secrets.PAT || secrets.GITHUB_TOKEN }}"
4441 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."
4647
4748 # MegaLinter Configuration
4849 - name : MegaLinter Run
49- id : ml
50- # # latest release of major version
5150 uses : oxsecurity/megalinter/flavors/java@v8.1.0
51+ id : ml
5252 env :
53- # ADD CUSTOM ENV VARIABLES OR DEFINE IN MEGALINTER_CONFIG file
54- MEGALINTER_CONFIG : .github/config/megalinter.yaml
5553
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.
5855 VALIDATE_ALL_CODEBASE : >-
5956 ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}}
6057
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+
6178 # Upload MegaLinter artifacts
6279 - name : Archive production artifacts
63- if : ${{ success() }} || ${{ failure() }}
80+ if : success() || failure()
6481 uses : actions/upload-artifact@v4
6582 with :
6683 name : MegaLinter reports
0 commit comments