-
Notifications
You must be signed in to change notification settings - Fork 137
33 lines (31 loc) · 978 Bytes
/
blank.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
name: Label Previously Merged PRs
on:
workflow_dispatch: # Manual trigger
jobs:
label_merged_prs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/github-script@v7
with:
script: |
const { data: prs } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed',
sort: 'updated',
direction: 'desc',
per_page: 100
});
for (const pr of prs) {
if (pr.merged_at) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: ['hacktoberfest-accepted']
});
console.log(`Added label to PR #${pr.number}`);
}
}