-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (70 loc) · 2.3 KB
/
linters.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
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
name: Linters
on:
workflow_call:
workflow_dispatch:
pull_request:
branches: [ 'main' ]
push:
branches: [ 'main' ]
env:
HADOLINT_RESULTS_FILE: hadolint.sarif
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
hadolint:
name: dockerfile lint
permissions:
security-events: write
runs-on: ubuntu-22.04
steps:
- name: "setup: checkout repo"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Create sarif output folder
run: mkdir -p "${{ github.workspace }}/sarif"
- name: "scan: ./Dockerfile hadolint scan sarif output"
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
config: .github/configs/hadolint.yaml
format: sarif
output-file: "${{ github.workspace }}/sarif/main-${{ env.HADOLINT_RESULTS_FILE }}"
no-fail: false
failure-threshold: info
- name: "scan: .sources/Dockerfile.sources hadolint scan sarif output"
uses: hadolint/[email protected]
with:
dockerfile: .sources/Dockerfile.sources
config: .github/configs/hadolint.yaml
format: sarif
output-file: "${{ github.workspace }}/sarif/sources-${{ env.HADOLINT_RESULTS_FILE }}"
no-fail: true
failure-threshold: info
- name: "post: Upload results to security tab"
uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
with:
sarif_file: "${{ github.workspace }}/sarif"
- name: "scan: ./Dockerfile hadolint scan tty output"
if: always()
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
config: .github/configs/hadolint.yaml
format: tty
failure-threshold: warning
shellcheck:
name: shellcheck
runs-on: ubuntu-22.04
steps:
- name: "setup: checkout repo"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: "run shellcheck scan"
uses: ludeeus/action-shellcheck@00b27aa7cb85167568cb48a3838b75f4265f2bca # v2.0.0
with:
severity: warning
format: tty
ignore_paths: .github .sources
env:
SHELLCHECK_OPTS: -e SC2154