-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (79 loc) · 2.25 KB
/
linter.yml
File metadata and controls
88 lines (79 loc) · 2.25 KB
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
name: Lint Codebase
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
packages: read
statuses: write
concurrency:
group: linter-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint Codebase
runs-on: ubuntu-latest
permissions:
# To write linting fixes
contents: write
# To write Super-linter status checks
statuses: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
- name: Install Dependencies
id: install
run: npm ci
- name: Lint Codebase
id: super-linter
uses: super-linter/super-linter/slim@v8
env:
CHECKOV_FILE_NAME: .checkov.yml
DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: dist/**/*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: .
VALIDATE_ALL_CODEBASE: true
# Explicitly enable other desired linters (matching previous run behavior)
VALIDATE_BASH: true
VALIDATE_CHECKOV: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_GITLEAKS: true
VALIDATE_MARKDOWN: true
VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_PRE_COMMIT: true
VALIDATE_SPELL_CODESPELL: true
VALIDATE_TRIVY: true
VALIDATE_YAML: true
- name: Show differences
run: |
git diff
- name: Commit and push linting fixes
# Run only on:
# - Pull requests
# - Not on the default branch
if: >
github.event_name == 'pull_request' && github.ref_name !=
github.event.repository.default_branch
uses: stefanzweifel/git-auto-commit-action@v7
with:
branch:
${{ github.event.pull_request.head.ref || github.head_ref ||
github.ref }}
commit_message: 'chore: fix linting issues'
commit_user_name: super-linter
commit_user_email: super-linter@super-linter.dev