-
-
Notifications
You must be signed in to change notification settings - Fork 500
90 lines (76 loc) · 3.11 KB
/
megalinter.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
# All variables described in https://megalinter.io/latest/configuration/
name: MegaLinter
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
# Run Linters in parallel
# Cancel running job if new job is triggered
concurrency:
group: "${{ github.ref }}-${{ github.workflow }}"
cancel-in-progress: true
jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
# Give the default GITHUB_TOKEN write permission to commit and push, comment
# issues, and post new Pull Requests; remove the ones you do not need
permissions:
contents: write
issues: write
pull-requests: write
steps:
- run: echo "🚀 Job automatically triggered by ${{ github.event_name }}"
- run: echo "🐧 Job running on ${{ runner.os }} server"
- run: echo "🐙 Using ${{ github.ref }} branch from ${{ github.repository }} repository"
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
docs
overrides
.github
- run: echo "🐙 Sparse Checkout of ${{ github.repository }} repository to the CI runner."
# MegaLinter Configuration
- name: MegaLinter Run
uses: oxsecurity/megalinter/flavors/java@v8.1.0
id: ml
env:
# Validate the git diff against default branch.
VALIDATE_ALL_CODEBASE: >-
${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # report individual linter status
# ADD CUSTOM ENV VARIABLES OR DEFINE IN MEGALINTER_CONFIG file
MEGALINTER_CONFIG: .github/config/megalinter.yaml
# Grafana Dashboard Connections - GitHub Organization secrets
API_REPORTER: true
API_REPORTER_URL: ${{ secrets.API_REPORTER_URL }}
API_REPORTER_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
API_REPORTER_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
API_REPORTER_BEARER_TOKEN: ${{ secrets.API_REPORTER_BEARER_PASSWORD }}
API_REPORTER_METRICS_URL: ${{ secrets.API_REPORTER_METRICS_URL }}
API_REPORTER_METRICS_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
API_REPORTER_METRICS_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
API_REPORTER_METRICS_BEARER_TOKEN: ${{ secrets.API_REPORTER_METRICS_BEARER_PASSWORD }}
API_REPORTER_DEBUG: false
# Logging
# LOG_LEVEL: DEBUG
# Upload MegaLinter artifacts
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log
# Summary and status
- run: echo "🎨 MegaLinter quality checks completed"
- run: echo "🍏 Job status is ${{ job.status }}."