-
Notifications
You must be signed in to change notification settings - Fork 18
/
action.yml
128 lines (117 loc) · 5.47 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: 'Repolinter Action'
description: 'Runs Repolinter against a repository, then uses the results to open an issue.'
author: 'New Relic Opensource'
inputs:
directory:
required: false
description: >
The directory Repolinter should run against. Accepts an absolute path
or a path relative to $GITHUB_WORKSPACE.
Defaults to $GITHUB_WORKSPACE.
default: ${{ github.workspace }}
token:
required: false
description: >
Personal access token (PAT) used to create an issue on this repository.
This token is optional and only required if this actions is configured to
output an issue (see output_type). This token must have the `public_repo`
scope for the current repository in order to work properly.
If you set this field to a custom token, you will also need to change
`username` to the username associated with the token provided.
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
default: ${{ github.token }}
username:
required: false
description: >
The username associated with the `token` field. Repolinter-action uses
this value to determine which issues have been created by itself. Prefix
this value with `app/` if `token` is generated from a GitHub app instead
of a normal user (see https://docs.github.com/en/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-by-author).
Defaults to the username associated with the `GITHUB_TOKEN` provided by Github
Actions.
default: app/github-actions
config_file:
required: false
description: >
A path to the JSON or YAML Repolinter ruleset to use, relative to the
working directory (i.e. under `$GITHUB_WORKSPACE`).
This option is mutually exclusive with config_url. If this option and
config-url are not specified, Repolinter's default ruleset will be used.
config_url:
required: false
description: >
A URL to pull the JSON or YAML Repolinter ruleset from. This URL must be accessible
by the actions runner and return raw JSON file on GET.
This option can be used to pull a ruleset from GitHub using the
raw.githubusercontent.com URL (ex. https://raw.githubusercontent.com/aperture-science-incorporated/.github/master/repolinter-newrelic-communityplus.json).
This option is mutually exclusive with config_url. If this option and
config-url are not specified, Repolinter's default ruleset will be used.
repository:
required: false
description: >
The repository name and owner, formatted like so: `owner/repository`.
This input determines which repository repolinter-action will create
an issue on, if that functionality is enabled.
It is recommended that this option is left as the default value.
default: ${{ github.repository }}
output_type:
required: false
description: >
Where repolinter-action should put the linting results. There are two
options available:
* "exit-code": repolinter-action will print the lint output to the console
and set the exit code to result.passed. This output type is most useful for
PR status checks.
* "issue": repolinter-action will create a GitHub issue on the current
repository with the repolinter output and always exit 0. See the README for
more details on issue outputting behavior. This output type is ideal for
non-intrusive notification.
default: 'exit-code'
output_name:
required: false
description: >
The title to use for the issue created by repolinter-action. This title
should indicate the purpose of the issue, as well as that it was created by
a bot.
This option will be ignored if output_type != "issue".
default: '[Repolinter] Open Source Policy Issues'
label_name:
required: false
description: >
The name to use for the issue label created by repolinter-action. This name
should be unique to repolinter-action (i.e. not used by any other issue) to
prevent repolinter-action from getting confused.
This option will be ignored if output_type != "issue".
default: 'repolinter'
label_color:
required: false
description: >
The color to use for the issue label created by repolinter-action. The value
for this option should be an unprefixed RRGGBB hex string (ex. ff568a).
The default value is a shade of yellow.
This option will be ignored if output_type != "issue".
default: 'fbca04'
outputs:
passed:
description: 'A boolean indicating whether or not the Repolinter run passed or failed.'
errored:
description: 'A boolean indicating whether or not the action threw any errors.'
json_output:
description: 'The JSON output from the repolinter run, from repolinter.jsonFormatter.'
runs:
using: 'docker'
image: docker://ghcr.io/newrelic/repolinter-action:v1.7.0
env:
INPUT_DIRECTORY: ${{ inputs.directory }}
INPUT_TOKEN: ${{ inputs.token }}
INPUT_USERNAME: ${{ inputs.username }}
INPUT_CONFIG_FILE: ${{ inputs.config_file }}
INPUT_CONFIG_URL: ${{ inputs.config_url }}
INPUT_REPOSITORY: ${{ inputs.repository }}
INPUT_OUTPUT_TYPE: ${{ inputs.output_type }}
INPUT_OUTPUT_NAME: ${{ inputs.output_name }}
INPUT_LABEL_NAME: ${{ inputs.label_name }}
INPUT_LABEL_COLOR: ${{ inputs.label_color }}
branding:
color: green
icon: refresh-cw