-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yml
149 lines (126 loc) · 3.86 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Issue Forms Version Dropdown
description: |
Populates options for a version dropdown issue forms element
Extends https://github.com/ShaMan123/gha-form-dropdown-options
author: ShaMan123
branding:
icon: hash
color: black
inputs:
github_token:
description: Github token
default: ${{ github.token }}
package:
description: |
The name of the published package
By default infers:
- npm package from `package.json`
- github repo from context
type: string
registry:
description: The name of the registry the package is published at
default: npm
type: string
options:
- npm
- github
order:
description: Display order of populated tags
default: desc
type: choice
options:
- desc
- asc
limit_to:
description: Limit populated tags
type: number
semver:
description: |
A semver range query used to filter satisfying tags
see [semver satisfies](https://github.com/npm/node-semver#ranges-1)
type: string
tags:
description: |
A stringified array of tags overriding fetching `package` tags from `registry`
Overrides `order`, `limit_to` and dismisses outputs as well
Consider using https://github.com/ShaMan123/gha-form-dropdown-options directly
type: string
# inherited from https://github.com/ShaMan123/gha-form-dropdown-options
template:
description: |
The location of the template file used to build the form, useful for ease of maintenance
type: string
form:
description: |
The location of the yaml form file
default: .github/ISSUE_TEMPLATE/bug_report.yml
type: string
dropdown:
description: |
The id of the dropdown in the yaml form to populate tags into prefixed with $
default: _version
type: string
label:
description: |
The label of the dropdown
type: string
description:
description: |
The description of the dropdown
type: string
commit_message:
type: string
dry_run:
description: |
see https://github.com/ShaMan123/gha-form-dropdown-options for the rest
type: choice
options:
- no-write
- no-commit
- no-push
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-declaring-outputs-for-composite-actions
outputs:
tags:
description: A stringified array of the resulting tags
value: ${{ steps.main.outputs.tags }}
latest:
description: Latest tag of `package` in `registry`
value: ${{ steps.main.outputs.latest }}
# inherited from https://github.com/ShaMan123/gha-form-dropdown-options
form:
description: JSON stringified form
value: ${{ steps.write.outputs.form }}
modified:
description: |
see https://github.com/ShaMan123/gha-form-dropdown-options
value: ${{ steps.write.outputs.modified }}
pushed:
description: |
see https://github.com/ShaMan123/gha-form-dropdown-options
value: ${{ steps.write.outputs.pushed }}
runs:
using: composite
steps:
- name: Fetch tags from ${{ inputs.registry }}:${{ inputs.package }}
id: main
if: ${{ !inputs.tags }}
run: |
node ${{ github.action_path }}/dist/main.cjs
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
INPUT_PACKAGE: ${{ inputs.package }}
INPUT_REGISTRY: ${{ inputs.registry }}
INPUT_ORDER: ${{ inputs.order }}
INPUT_LIMIT_TO: ${{ inputs.limit_to }}
INPUT_SEMVER: ${{ inputs.semver }}
- name: Set dropdown options
id: write
uses: ShaMan123/[email protected]
with:
template: ${{ inputs.template }}
form: ${{ inputs.form }}
dropdown: ${{ inputs.dropdown }}
options: ${{ inputs.tags || steps.main.outputs.tags }}
commit_message: ${{ inputs.commit_message }}
dry_run: ${{ inputs.dry_run }}