-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.15 KB
/
autotag.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
name: autotag
on:
workflow_run:
workflows:
- brew test-bot
types:
- completed
branches-ignore:
- main
jobs:
autotag:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
permissions:
issues: write
steps:
- uses: actions/github-script@v7
with:
script: |
for (const pr in context.payload.workflow_run.pull_requests) {
const owner = context.payload.repository.owner.login;
const repo = context.payload.repository.name;
const issue = github.rest.issues.get({
owner,
repo,
issue_number: pr.number
});
const labels = issue.labels.map(label => label.name);
if (!labels.includes("autopull")) {
continue;
}
github.rest.issues.addLabels({
owner,
repo,
issue_number: pr.number,
labels: [{
name: "pr-pull"
}]
});
}