-
Notifications
You must be signed in to change notification settings - Fork 9.2k
270 lines (234 loc) · 11.4 KB
/
pull_request_target.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
name: Process pull_request_target Events
on:
pull_request_target:
types:
- assigned
- closed
- edited
- labeled
- opened
- ready_for_review
env:
ISSUE_URL: ${{ github.event.pull_request.html_url }}
jobs:
labels:
name: Labelers
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
sparse-checkout: .github
- name: Apply Service Labels
if: contains(fromJSON('["opened", "edited"]'), github.event.action)
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
configuration-path: .github/labeler-pr-triage.yml
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Apply Size Labels
if: contains(fromJSON('["opened", "edited"]'), github.event.action)
uses: codelytv/pr-size-labeler@c7a55a022747628b50f3eb5bf863b9e796b8f274 # v1.10.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: "size/XS"
xs_max_size: "30"
s_label: "size/S"
s_max_size: "60"
m_label: "size/M"
m_max_size: "150"
l_label: "size/L"
l_max_size: "300"
xl_label: "size/XL"
message_if_xl: ""
- name: "Community Check: Author"
id: author
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.pull_request.user.login }}
maintainers: ${{ secrets.MAINTAINERS }}
core_contributors: ${{ secrets.CORE_CONTRIBUTORS }}
partners: ${{ secrets.PARTNERS }}
- name: Add needs-triage to New Contributions
if: |
github.event.action == 'opened'
&& steps.author.outputs.maintainer == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr edit "$ISSUE_URL" --add-label needs-triage
- name: Add prioritized to New Maintainer Contributions
if: |
github.event.action == 'opened'
&& steps.author.outputs.maintainer == 'true'
&& !contains(github.event.pull_request.labels.*.name, 'prioritized')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr edit "$ISSUE_URL" --add-label prioritized
- name: Credit Core Contributor Contributions
if: |
steps.author.outputs.core_contributor == 'true'
&& !contains(github.event.pull_request.labels.*.name, 'external-maintainer')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit "$ISSUE_URL" --add-label external-maintainer
- name: Credit Partner Contributions
if: |
steps.author.outputs.partner == 'true'
&& !contains(github.event.pull_request.labels.*.name, 'partner')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 When Assigned to a Maintainer
if: steps.assignee.outputs.maintainer == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit "$ISSUE_URL" --add-label prioritized
- name: Remove Triage Labels on Closure
if: |
github.event.action == 'closed'
&& (contains(github.event.pull_request.labels.*.name, 'needs-triage') || contains(github.event.pull_request.labels.*.name, 'waiting-response'))
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr edit "$ISSUE_URL" --remove-label needs-triage,waiting-response
project:
name: Maintainer Work Board
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
id: token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PEM }}
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
sparse-checkout: .github/actions/
- name: Community Check
id: community_check
if: contains(fromJSON('["opened", "assigned"]'), github.event.action)
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.action == 'assigned' && github.event.assignee.login || github.event.pull_request.user.login }}
maintainers: ${{ secrets.MAINTAINERS }}
- name: Maintainer Pull Requests
if: |
github.event.action == 'opened'
&& steps.community_check.outputs.maintainer == 'true'
uses: ./.github/actions/team_working_board
with:
github_token: ${{ steps.token.outputs.token }}
item_url: ${{ github.event.pull_request.html_url }}
status: "Maintainer PR"
view: "working-board"
- name: Assigned to Maintainers
if: |
github.event.action == 'assigned'
&& steps.community_check.outputs.maintainer == 'true'
uses: ./.github/actions/team_working_board
with:
github_token: ${{ steps.token.outputs.token }}
item_url: ${{ github.event.pull_request.html_url }}
status: "In Progress"
view: "working-board"
- name: Labeled Prioritized
if: github.event.label.name == 'prioritized'
uses: ./.github/actions/team_working_board
with:
github_token: ${{ steps.token.outputs.token }}
item_url: ${{ github.event.pull_request.html_url }}
view: "working-board"
- name: Labeled Engineering Initiative
if: github.event.label.name == 'engineering-initiative'
uses: ./.github/actions/team_working_board
with:
github_token: ${{ steps.token.outputs.token }}
item_url: ${{ github.event.pull_request.html_url }}
view: "engineering-initiative"
add_to_milestone:
name: Add Merged Pull Requests and Related Issues to Milestone
if: github.event.action == 'closed' && github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Get Current Milestone Name
id: get-current-milestone
run: echo "current_milestone=v$(head -1 CHANGELOG.md | cut -d " " -f 2)" >> "$GITHUB_OUTPUT"
- name: Add Items to Milestone
env:
GH_TOKEN: ${{ github.token }}
MILESTONE: ${{ steps.get-current-milestone.outputs.current_milestone }}
PR_NUMBER: ${{ github.event.pull_request.number }}
shell: bash
run: ./.ci/scripts/add-to-milestone.sh
community_note:
name: Community Note
if: github.event.action == 'opened'
runs-on: ubuntu-latest
steps:
- name: Add community note to new Pull Requests
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
# Community Note
**Voting for Prioritization**
* Please vote on this pull request by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original post to help the community and maintainers prioritize this pull request.
* Please see our [prioritization guide](https://hashicorp.github.io/terraform-provider-aws/prioritization/) for information on how we prioritize.
* Please **do not** leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
**For Submitters**
* Review the [contribution guide](https://hashicorp.github.io/terraform-provider-aws/) relating to the type of change you are making to ensure all of the necessary steps have been taken.
* For new resources and data sources, use [skaff](https://hashicorp.github.io/terraform-provider-aws/skaff/) to generate scaffolding with comments detailing common expectations.
* Whether or not the branch has been rebased will **not** impact prioritization, but doing so is always a welcome surprise.
first_contribution_note:
name: New Contributor Note
if: github.event.action == 'opened'
runs-on: ubuntu-latest
steps:
- name: Add comment to add helpful context for new contributors
uses: actions/first-interaction@34f15e814fe48ac9312ccf29db4e74fa767cbab7 # v1.3.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: |-
Welcome @${{github.actor}} :wave:
It looks like this is your first Pull Request submission to the [Terraform AWS Provider](https://github.com/hashicorp/terraform-provider-aws)! If you haven’t already done so please make sure you have checked out our [CONTRIBUTOR](https://hashicorp.github.io/terraform-provider-aws/) guide and [FAQ](https://hashicorp.github.io/terraform-provider-aws/faq/) to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our [FAQ](https://hashicorp.github.io/terraform-provider-aws/faq/) which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! :smiley:
permissions_check:
name: Verify Maintainers Can Edit
runs-on: ubuntu-latest
if: github.event.action == 'opened'
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
sparse-checkout: .github/actions/community_check
- name: Community Check
id: community_check
uses: ./.github/actions/community_check
with:
user_login: ${{ github.event.action == 'assigned' && github.event.assignee.login || github.event.pull_request.user.login }}
maintainers: ${{ secrets.MAINTAINERS }}
- name: Comment if Not
if: |
steps.community_check.outputs.maintainer == 'false'
&& !github.event.pull_request.maintainer_can_modify
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Hey @${{ github.actor }} :wave: Thank you very much for your contribution! At times, our maintainers need to make direct edits to pull requests in order to help get it ready to be merged. Your current settings do not allow maintainers to make such edits. To help facilitate this, update your pull request to allow such edits as described in GitHub's [Allowing changes to a pull request branch created from a fork][1] documentation. (If you're using a fork owned by an organization, your organization may not allow you to change this setting. If that is the case, let us know.)
[1]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork