-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Expand file tree
/
Copy pathadd-actionable-obs-author-label.yml
More file actions
45 lines (40 loc) · 1.29 KB
/
add-actionable-obs-author-label.yml
File metadata and controls
45 lines (40 loc) · 1.29 KB
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
name: Add author:actionable-obs label to PRs
on:
pull_request_target:
types: [opened]
jobs:
label-actionable-obs-team:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Label if author is in the actionable-obs team
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const actionableObsTeam = [
"jasonrhodes",
"ana-davydova",
"baileycash-elastic",
"benakansara",
"dominiqueclarke",
"fkanout",
"cesco-f",
"kdelemme",
"miguelmartin-elastic",
"miltonhultgren",
"mgiota",
"shahzad31",
"yiannisnikolopoulos"
]; // GitHub usernames
const label = "author:actionable-obs";
const author = context.payload.pull_request.user.login;
if (actionableObsTeam.includes(author)) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: [label],
});
}