-
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (57 loc) · 2.21 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
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.github.io
name: MegaLinter
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
# env:
# # Apply linter fixes configuration
# APPLY_FIXES: all # APPLY_FIXES must be defined as environment variable
# APPLY_FIXES_EVENT: pull_request # events that trigger fixes on a commit or PR (pull_request, push, all)
# APPLY_FIXES_MODE: commit # are fixes are directly committed (commit) or posted in a PR (pull_request)
# 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
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:
token: "${{ secrets.PAT || secrets.GITHUB_TOKEN }}"
fetch-depth: 0
- run: echo "🐙 ${{ github.repository }} repository was cloned to the runner."
# MegaLinter Configuration
- name: MegaLinter Run
id: ml
## latest release of major version
uses: oxsecurity/megalinter/flavors/[email protected]
env:
MEGALINTER_CONFIG: .github/config/megalinter.yaml
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # report individual linter status
# Validate all source when push on main, else just the git diff with live.
VALIDATE_ALL_CODEBASE: >-
${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}}
# Upload MegaLinter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/[email protected]
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 }}."