-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 2.12 KB
/
super-linter.yml
File metadata and controls
68 lines (61 loc) · 2.12 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
---
name: Lint
on:
push:
pull_request:
permissions:
contents: read
jobs:
# ✅ Step 1: Run Super-Linter in check-only mode (does not fix issues)
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Super-Linter (Check Only)
uses: super-linter/super-linter@v7.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_MARKDOWN: true
VALIDATE_TERRAFORM_FMT: true
VALIDATE_TERRAFORM_TERRASCAN: true
VALIDATE_TERRAFORM_TFLINT: true
VALIDATE_PYTHON_BLACK: true
VALIDATE_PYTHON_PYLINT: true
VALIDATE_PYTHON_ISORT: true
VALIDATE_PYTHON_MYPY: true
VALIDATE_PYTHON_BANDIT: true
# ✅ Step 2: Run Super-Linter in fix mode and commit changes
fix-lint-issues:
permissions:
contents: write # Allows writing fixed files
statuses: write # Allows updating PR status
checks: write # Allows updating PR checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Super-Linter (Fix Mode)
uses: super-linter/super-linter@v7.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ✅ Enable auto-fix for Shell, Python, YAML, Markdown, and Terraform:
FIX_SHELL_SHFMT: true
FIX_YAML_PRETTIER: true
FIX_PYTHON_BLACK: true
FIX_PYTHON_ISORT: true
FIX_PYTHON_PYINK: true
FIX_MARKDOWN: true
FIX_TERRAFORM_FMT: true
- name: Commit and push linting fixes
if: github.event_name == 'pull_request' && github.ref_name != github.event.repository.default_branch
uses: stefanzweifel/git-auto-commit-action@v5
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