-
Notifications
You must be signed in to change notification settings - Fork 797
38 lines (33 loc) · 1.16 KB
/
milestone.yml
File metadata and controls
38 lines (33 loc) · 1.16 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
name: Assign milestone to PRs
on:
pull_request_target:
types: [opened, reopened]
jobs:
assign-milestone:
name: Assign next-release milestone
runs-on: ubuntu-latest
if: contains(fromJSON('["dependabot[bot]", "transifex-integration[bot]", "imgbot[bot]", "Copilot", "BornToBeRoot"]'), github.event.pull_request.user.login)
permissions:
issues: write
pull-requests: write
steps:
- name: Assign milestone
uses: actions/github-script@v7
with:
script: |
const milestones = await github.rest.issues.listMilestones({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open'
});
const milestone = milestones.data.find(m => m.title === 'next-release');
if (!milestone) {
core.warning('Milestone "next-release" not found');
return;
}
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
milestone: milestone.number
});