forked from jbergstroem/hadolint-gh-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
69 lines (65 loc) · 2.47 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
67
68
69
name: "Hadolint Github Action"
description: "A stable, well-tested, highly configurable way of checking your Dockerfile(s) with Hadolint"
author: "Johan Bergström <[email protected]>"
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
run: |
echo "::debug::Downloading Hadolint ${{ inputs.version }}"
mkdir ${{ github.action_path }}/bin
curl -L -s -o ${{ github.action_path }}/bin/hadolint \
"https://github.com/hadolint/hadolint/releases/download/v${{ inputs.version }}/hadolint-Linux-x86_64"
chmod +x ${{ github.action_path }}/bin/hadolint
echo "${{ github.action_path }}/bin" >> "${GITHUB_PATH}"
- 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"