-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
action.yml
84 lines (83 loc) · 2.89 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
name: 'Run shellcheck with reviewdog'
description: '🐶 Run shellcheck with reviewdog on pull requests to improve code review experience.'
author: 'haya14busa (reviewdog)'
inputs:
github_token:
description: 'GITHUB_TOKEN.'
default: '${{ github.token }}'
required: false
level:
description: 'Report level for reviewdog [info,warning,error]'
default: 'error'
required: false
reporter:
description: |
Reporter of reviewdog command [github-pr-check,github-pr-review,github-check].
Default is github-pr-check.
github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
default: 'github-pr-check'
required: false
filter_mode:
description: |
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is `file`.
default: 'file'
required: false
fail_on_error:
description: |
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
default: 'false'
required: false
reviewdog_flags:
description: 'Additional reviewdog flags'
default: ''
required: false
path:
description: "Base directory to run shellcheck. Same as `[path]` of `find` command."
default: '.'
required: false
pattern:
description: "File patterns of target files. Same as `-name [pattern]` of `find` command."
default: '*.sh'
required: false
check_all_files_with_shebangs:
description: |
Checks all files with shebangs in the repository even if they do not match the pattern.
Default is `false`.
default: 'false'
required: false
exclude:
description: "Exclude patterns of target files. Same as `-not -path [exclude]` of `find` command."
default: '*/.git/*'
required: false
shellcheck_flags:
description: "Flags of shellcheck command."
default: '--external-sources'
required: false
runs:
using: "composite"
steps:
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: v0.20.2
- run: $GITHUB_ACTION_PATH/script.sh
shell: bash
env:
SHELLCHECK_VERSION: 0.10.0
# 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_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_PATH: ${{ inputs.path }}
INPUT_PATTERN: ${{ inputs.pattern }}
INPUT_EXCLUDE: ${{ inputs.exclude }}
INPUT_CHECK_ALL_FILES_WITH_SHEBANGS: ${{ inputs.check_all_files_with_shebangs }}
INPUT_SHELLCHECK_FLAGS: ${{ inputs.shellcheck_flags }}
branding:
icon: 'zoom-in'
color: 'purple'