-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.33 KB
/
hadolint.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
name: lint dockerfile
on:
push:
branches: [ main ]
paths:
- .github/workflows/hadolint.yml
- Dockerfile
pull_request:
types: [ opened, synchronize, reopened ]
paths:
- .github/workflows/hadolint.yml
- Dockerfile
jobs:
hadolint:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: hadolint/[email protected]
id: hadolint
with:
dockerfile: Dockerfile
ignore: DL3008
continue-on-error: true
- name: Update Pull Request
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `
#### Hadolint: \`${{ steps.hadolint.outcome }}\`
\`\`\`
${process.env.HADOLINT_RESULTS}
\`\`\`
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- name: Set Overall Status
if: steps.hadolint.outcome == 'failure'
run: exit 1