generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 121
134 lines (115 loc) · 4.63 KB
/
labelers.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
name: Label Automations
permissions:
contents: read
issues: write
pull-requests: write
on:
issues:
types:
- closed
- edited
- opened
issue_comment:
types:
- created
pull_request_target:
types:
- assigned
- closed
- edited
- opened
jobs:
repo_and_community:
name: Repository and Community Labels
runs-on: ubuntu-latest
env:
GH_CLI_SUBCOMMAND: ${{ (github.event.issue.pull_request || github.event.pull_request) && 'pr' || 'issue' }}
GH_TOKEN: ${{ github.token }}
ISSUE_URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
LABELS: ${{ toJSON(github.event.issue.labels.*.name || github.event.pull_request.labels.*.name) }}
steps:
- name: Checkout Community Check
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: .github/actions/community_check
- name: "Community Check: Author"
id: author
if: github.event.action == 'opened'
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.issue.user.login || github.event.pull_request.user.login }}
maintainers: ${{ secrets.MAINTAINERS }}
core_contributors: ${{ secrets.CORE_CONTRIBUTORS }}
partners: ${{ secrets.PARTNERS }}
- name: Indicate That Triage is Required
if: |
steps.author.conclusion != 'skipped'
&& steps.author.outputs.maintainer != 'true'
run: |
gh $GH_CLI_SUBCOMMAND edit "$ISSUE_URL" --add-label needs-triage
- name: Credit Core Contributor Contributions
if: |
github.event_name == 'pull_request_target'
&& steps.author.conclusion != 'skipped'
&& steps.author.outputs.core_contributor == 'true'
run: |
gh pr edit "$ISSUE_URL" --add-label external-maintainer
- name: Add prioritized to Maintainer Contributions
if: |
github.event_name == 'pull_request_target'
&& steps.author.conclusion != 'skipped'
&& steps.author.outputs.maintainer == 'true'
run: |
gh pr edit "$ISSUE_URL" --add-label prioritized
- name: Credit Partner Contributions
if: |
github.event_name == 'pull_request_target'
&& steps.author.conclusion != 'skipped'
&& steps.author.outputs.partner == 'true'
run: |
gh pr edit "$ISSUE_URL" --add-label partner
- name: "Community Check: Assignee"
id: assignee
if: github.event.action == 'assigned'
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.assignee.login }}
maintainers: ${{ secrets.MAINTAINERS }}
- name: Add prioritized to Maintainer Assignments
if: |
steps.assignee.conclusion != 'skipped'
&& steps.assignee.outputs.maintainer == 'true'
run: |
gh $GH_CLI_SUBCOMMAND edit "$ISSUE_URL" --add-label prioritized
- name: "Community Check: Editor"
id: editor
if: github.event.action == 'edited'
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.sender.login }}
maintainers: ${{ secrets.MAINTAINERS }}
- name: Remove Stale Indicators on Non-Maintainer Edit
if: |
(steps.editor.conclusion != 'skipped' && steps.editor.outputs.maintainer != 'true')
&& (contains(fromJSON(env.LABELS), 'stale') || contains(fromJSON(env.LABELS), 'waiting-response'))
run: |
gh $GH_CLI_SUBCOMMAND edit "$ISSUE_URL" --remove-label stale,waiting-response
- name: "Community Check: Commenter"
id: commenter
if: github.event.action == 'created'
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.comment.user.login }}
maintainers: ${{ secrets.MAINTAINERS }}
- name: Remove Stale Indicators on Non-Maintainer Comment
if: |
(steps.commenter.conclusion != 'skipped' && steps.commenter.outputs.maintainer != 'true')
&& (contains(fromJSON(env.LABELS), 'stale') || contains(fromJSON(env.LABELS), 'waiting-response'))
run: |
gh $GH_CLI_SUBCOMMAND edit "$ISSUE_URL" --remove-label stale,waiting-response
- name: Remove Triage Labels on Closure
if: |
github.event.action == 'closed'
&& (contains(fromJSON(env.LABELS), 'needs-triage') || contains(fromJSON(env.LABELS), 'waiting-response'))
run: |
gh $GH_CLI_SUBCOMMAND edit "$ISSUE_URL" --remove-label needs-triage,waiting-response