Skip to content

Commit 620071f

Browse files
authored
Merge branch 'development' into feature/pr-title-linter
2 parents 306d023 + af94fbd commit 620071f

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/super-linter.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Lint
3+
4+
on:
5+
push:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
# ✅ Step 1: Run Super-Linter in check-only mode (does not fix issues)
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Run Super-Linter (Check Only)
22+
uses: super-linter/super-linter@v7.3.0
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
25+
VALIDATE_ALL_CODEBASE: true
26+
27+
# ✅ Step 2: Run Super-Linter in fix mode and commit changes
28+
fix-lint-issues:
29+
permissions:
30+
contents: write # Allows writing fixed files
31+
statuses: write # Allows updating PR status
32+
checks: write # Allows updating PR checks
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Run Super-Linter (Fix Mode)
41+
uses: super-linter/super-linter@v7.3.0
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
44+
# ✅ Enable auto-fix for Shell, Python, YAML, Markdown, and Terraform:
45+
FIX_SHELL_SHFMT: true
46+
FIX_YAML_PRETTIER: true
47+
FIX_PYTHON_BLACK: true
48+
FIX_PYTHON_ISORT: true
49+
FIX_PYTHON_PYINK: true
50+
FIX_MARKDOWN: true
51+
FIX_TERRAFORM_FMT: true
52+
53+
- name: Commit and push linting fixes
54+
if: github.event_name == 'pull_request' && github.ref_name != github.event.repository.default_branch
55+
uses: stefanzweifel/git-auto-commit-action@v5
56+
with:
57+
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
58+
commit_message: "chore: fix linting issues"
59+
commit_user_name: super-linter
60+
commit_user_email: super-linter@super-linter.dev

0 commit comments

Comments
 (0)