generated from reviewdog/action-composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
action.yml
95 lines (94 loc) · 3.19 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
name: 'Run Prettier with reviewdog'
description: '🐶 Run Prettier with reviewdog to improve code checking, formatting and review experience for your codebase.'
author: 'EPMatt'
inputs:
github_token:
description: 'GITHUB_TOKEN'
default: '${{ github.token }}'
required: false
workdir:
description: |
Working directory relative to the root directory.
This is where the action will look for a
package.json which declares Prettier as a dependency.
Please note that this is different from the directory
Prettier will run on, which is defined in the prettier_flags input.
Default is `.`.
default: '.'
required: false
### Flags for reviewdog ###
level:
description: |
Report level for reviewdog [info,warning,error].
Default is `error`.
default: 'error'
required: false
reporter:
description: |
Reporter of reviewdog command [github-check,github-pr-check,github-pr-review].
Default is `github-pr-check`.
default: 'github-pr-check'
required: false
filter_mode:
description: |
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is `added`.
default: 'added'
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 is ``.
default: ''
required: false
tool_name:
description: 'Tool name to use for reviewdog reporter'
default: 'prettier'
required: false
### Flags for prettier ###
prettier_flags:
description: |
Flags and args to pass to Prettier.
If you override this input, please make sure to append to it the directory
which Prettier will run on.
The path provided here is relative to the workdir path, provided in the workdir input.
Default is `.`, which makes Prettier run on the path provided in the workdir input.
default: '.'
required: false
runs:
using: 'composite'
steps:
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: v0.14.2
- run: $GITHUB_ACTION_PATH/script.sh
shell: bash
env:
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_WORKDIR: ${{ inputs.workdir }}
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_TOOL_NAME: ${{ inputs.tool_name }}
INPUT_PRETTIER_FLAGS: ${{ inputs.prettier_flags }}
- if: ${{ inputs.reporter == 'github-pr-review' && always() }}
uses: reviewdog/action-suggester@v1
with:
github_token: ${{ inputs.github_token }}
tool_name: ${{ inputs.tool_name }}
level: ${{ inputs.level }}
filter_mode: ${{ inputs.filter_mode }}
fail_on_error: ${{ inputs.fail_on_error }}
reviewdog_flags: ${{ inputs.reviewdog_flags }}
# Ref: https://haya14busa.github.io/github-action-brandings/
branding:
icon: 'align-left'
color: 'blue'