-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
66 lines (61 loc) · 2.16 KB
/
action.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
name: "Hadolint Github Action"
description: "A stable, well-tested, highly configurable way of checking your Dockerfile(s) with Hadolint"
author: "Johan Bergström <bugs@bergstroem.nu>"
inputs:
dockerfile:
default: "./Dockerfile"
description: Path to Dockerfile(s). Accepts shell expansions (`**/Dockerfile`)
required: true
config_file:
description: Path to optional config (hadolint defaults to read `./hadolint.yml` if it exists)
required: false
error_level:
default: 0
description: Fail CI based on hadolint output (`-1` never, `0` error, `1` warning, `2` info/style)
required: false
annotate:
default: true
description: Annotate code inline in the github PR viewer (`true`/`false`)
required: true
output_format:
description: Output format (choose between `checkstyle`, `codeclimate`, `gitlab_codeclimate`, `json` or `tty`)
required: false
hadolint_path:
description: Absolute path to hadolint binary. Left unset means it can be found in `$PATH`
required: false
version:
default: 2.12.0
description: Use a specific version of Hadolint
required: true
outputs:
hadolint_output:
description: Optional output from Hadolint, controlled with `output_format`
value: ${{ steps.run.outputs.hadolint_output }}
hadolint_version:
description: Hadolint version in use
value: ${{ steps.run.outputs.hadolint_version }}
hadolint_gh_action_version:
description: hadolint-gh-action version in use
value: ${{ steps.run.outputs.hadolint_gh_action_version }}
runs:
using: composite
steps:
- name: Download hadolint and make it available in path
shell: bash
env:
version: ${{ inputs.version }}
run: ${{ github.action_path }}/install.sh
- name: Invoke hadolint.sh
id: run
shell: bash
env:
dockerfile: ${{ inputs.dockerfile }}
config_file: ${{ inputs.config_file }}
error_level: ${{ inputs.error_level }}
annotate: ${{ inputs.annotate }}
output_format: ${{ inputs.output_format }}
version: ${{ inputs.version }}
run: ${{ github.action_path }}/hadolint.sh
branding:
icon: "check"
color: "green"