Skip to content

Commit 71c5dc8

Browse files
committed
(maint) turn labeller into a template
1 parent 7495c10 commit 71c5dc8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/labeller.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
name: Labeller
22

33
on:
4-
issues:
5-
types:
6-
- opened
7-
- labeled
8-
- unlabeled
9-
pull_request_target:
10-
types:
11-
- opened
12-
- labeled
13-
- unlabeled
4+
workflow_call:
5+
inputs:
6+
token:
7+
default: ''
8+
type: string
149

1510
jobs:
1611
label:
12+
name: ${{ github.event.action }} ${{ github.event_name }}
13+
# case if the workflow is called improperly
14+
if: |
15+
contains(fromJson('["puppetlabs", "puppet-toy-chest"]'), github.repository_owner) &&
16+
contains(fromJson('["pull_request_target", "issues"]'), github.event_name) &&
17+
contains(fromJson('["opened", "reopened", "labeled", "unlabeled"]'), github.event.action)
1718
runs-on: ubuntu-latest
1819
steps:
19-
2020
- uses: puppetlabs/[email protected]
2121
name: Label issues or pull requests
2222
with:
2323
label_name: community
2424
label_color: '5319e7'
2525
org_membership: puppetlabs
2626
fail_if_member: 'true'
27-
token: ${{ secrets.IAC_COMMUNITY_LABELER }}
27+
token: ${{ inputs.token != '' && inputs.token || secrets.IAC_COMMUNITY_TOKEN }}

0 commit comments

Comments
 (0)