-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
action.yml
72 lines (71 loc) · 2.56 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
# TODO: replace `<linter-name>` and `<your-name>` with yours
name: 'Run <linter-name> with reviewdog'
description: '🐶 Run <linter-name> with reviewdog on pull requests to improve code review experience.'
author: '<your-name>'
inputs:
github_token:
description: 'GITHUB_TOKEN'
default: '${{ github.token }}'
workdir:
description: 'Working directory relative to the root directory.'
default: '.'
### Flags for reviewdog ###
tool_name:
description: 'Tool name to use for reviewdog reporter.'
default: '<linter-name>'
level:
description: 'Report level for reviewdog [info,warning,error].'
default: 'error'
reporter:
description: 'Reporter of reviewdog command [github-check,github-pr-review,github-pr-check,sarif].'
default: 'github-check'
filter_mode:
description: |
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is `added` except that sarif reporter uses `nofilter`.
default: ''
fail_on_error:
description: |
Exit code for reviewdog when errors are found [true,false].
Default is `false`.
default: 'false'
reviewdog_flags:
description: 'Additional reviewdog flags.'
default: ''
output_dir:
description: 'Output directory of reviewdog result. Useful for -reporter=sarif'
default: '../reviewdog-results'
### Flags for <linter-name> ###
locale:
description: '-locale flag of misspell. (US/UK)'
default: ''
runs:
using: 'composite'
steps:
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: v0.20.2
- run: $GITHUB_ACTION_PATH/script.sh
shell: bash
env:
# 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_WORKDIR: ${{ inputs.workdir }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
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_OUTPUT_DIR: ${{ inputs.output_dir }}
INPUT_LOCALE: ${{ inputs.locale }}
- if: inputs.reporter == 'sarif'
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ inputs.output_dir }}
# Ref: https://haya14busa.github.io/github-action-brandings/
# TODO: update branding if you want.
branding:
icon: 'check'
color: 'blue'