-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
action.yml
100 lines (96 loc) · 3.6 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: 'Run tflint with reviewdog'
description: '🐶 Run tflint with reviewdog on pull requests to enforce best practices'
author: 'vlaaaaaaad (reviewdog)'
inputs:
github_token:
description: 'GITHUB_TOKEN'
required: true
default: ${{ github.token }}
level:
description: 'Report level for reviewdog [info,warning,error]'
default: 'error'
reporter:
description: |
Reporter of reviewdog command [github-pr-check,github-pr-review].
Default is github-pr-check.
default: 'github-pr-check'
filter_mode:
description: |
Filtering for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
default: 'added'
fail_on_error:
description: |
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
default: 'false'
working_directory:
description: |
Directory to run the action on, from the repo root.
Default is . ( root of the repository)
default: '.'
tflint_version:
description: |
The tflint version to install and use.
Default is to use the latest release version.
default: 'latest'
tflint_rulesets:
description: |
Space separated, official (from the terraform-linters GitHub organization) tflint rulesets to install and use. If a pre-configured `TFLINT_PLUGIN_DIR` is set, rulesets are installed in that directory.
Default is empty.
default: ''
tflint_init:
description: |
Whether or not to run tflint --init prior to running scan [true,false]
Default is `false`.
default: 'false'
tflint_target_dir:
description: |
The target dir for the tflint command. This is the directory passed to tflint as opposed to working_directory which is the directory the command is executed from.
Default is . ( root of the repository)
default: '.'
tflint_config:
description: |
Config file name for tflint.
Default is `.tflint.hcl`.
default: '.tflint.hcl'
flags:
description: |
List of arguments to send to tflint
For the output to be parsable by reviewdog --format=checkstyle is enforced
Default is --call-module-type=all.
default: '--call-module-type=all'
outputs:
tflint-return-code:
description: 'tflint command return code'
value: ${{ steps.tflint.outputs.tflint-return-code }}
reviewdog-return-code:
description: 'reviewdog command return code'
value: ${{ steps.tflint.outputs.reviewdog-return-code }}
runs:
using: 'composite'
steps:
- run: $GITHUB_ACTION_PATH/script.sh
id: tflint
shell: bash
env:
# We may want to allow specifying reviewdog version as
# action's input, but let's start with hard coded latest stable version for reviewdog
REVIEWDOG_VERSION: v0.17.5
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }}
INPUT_TFLINT_VERSION: ${{ inputs.tflint_version }}
INPUT_TFLINT_RULESETS: ${{ inputs.tflint_rulesets }}
INPUT_TFLINT_INIT: ${{ inputs.tflint_init }}
INPUT_TFLINT_TARGET_DIR: ${{ inputs.tflint_target_dir }}
INPUT_TFLINT_CONFIG: ${{ inputs.tflint_config }}
INPUT_FLAGS: ${{ inputs.flags }}
branding:
icon: 'edit'
color: 'gray-dark'