-
-
Notifications
You must be signed in to change notification settings - Fork 200
57 lines (51 loc) · 1.45 KB
/
linter.yml
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
name: Lint Code Base
on:
workflow_dispatch:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
build:
name: Lint code base
runs-on: ubuntu-latest
steps:
# CHECKOUT CODE
- id: checkout-code
name: Checkout code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list
# of changed files within `super-linter`
fetch-depth: 0
# LINT CODE
- id: read-env
name: Use super-linter environmental variables
shell: bash
run: |
# Use super-linter environmental variables
cat .github/super-linter.env >> "$GITHUB_ENV"
- id: lint-code-base
name: Lint Code Base
uses: github/super-linter/slim@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: main
- id: strip-ansi-codes
name: Strip ANSI codes from log
if: always()
shell: bash
run: |
# Strip ANSI codes from log
mv super-linter.log original-super-linter.log
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" original-super-linter.log > super-linter.log
- id: persist-log
name: Persist linter logs
uses: actions/upload-artifact@v4
# Disable, since the logs leak the GitHub Actions token
if: false && always()
with:
name: super-linter-log
path: super-linter.log
retention-days: 9