generated from reviewdog/action-composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
89 lines (87 loc) · 3.17 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
name: 'Run ast-grep with reviewdog'
description: '🐶 Run ast-grep with reviewdog on pull requests to improve code review experience.'
author: 'rinx'
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: 'ast-grep'
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_level:
description: |
If set to `none`, always use exit code 0 for reviewdog.
Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.
Possible values: [none,any,info,warning,error]
Default is `none`.
default: 'none'
fail_on_error:
description: |
Deprecated, use `fail_level` instead.
Exit code for reviewdog when errors are found [true,false].
deprecationMessage: Deprecated, use `fail_level` instead.
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 ast-grep ###
sg_version:
description: 'ast-grep version.'
default: ''
sg_config:
description: 'path to the ast-grep config file'
default: 'sgconfig.yml'
sg_flags:
description: 'Additional ast-grep flags.'
default: ''
runs:
using: 'composite'
steps:
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: v0.20.3
- 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_LEVEL: ${{ inputs.fail_level }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_OUTPUT_DIR: ${{ inputs.output_dir }}
INPUT_SG_VERSION: ${{ inputs.sg_version }}
INPUT_SG_CONFIG: ${{ inputs.sg_config }}
INPUT_SG_FLAGS: ${{ inputs.sg_flags }}
DEFAULT_SG_VERSION: 0.33.1
- 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/
branding:
icon: 'check'
color: 'blue'