-
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (35 loc) · 1.08 KB
/
dockerfilelint.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
# 作成されたプルリクエストに対してDockerfileに変更があればhadolintを実行します。
name: Dockerfile lint
on:
pull_request:
paths:
- 'Dockerfile'
jobs:
lint:
name: Dockerfile lint by Hadolint Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
id: run_hadolint
with:
dockerfile: ./Dockerfile
no-color: false
no-fail: false
- name: Create pull request comment
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
script: |
const hadolintOutput = `
#### Hadolint: \`${{ steps.run_hadolint.outcome }}\`
\`\`\`
${process.env.HADOLINT_RESULTS}
\`\`\`
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: hadolintOutput,
});