-
Notifications
You must be signed in to change notification settings - Fork 597
25 lines (25 loc) · 1.24 KB
/
milestones.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
on:
pull_request_target:
types: [closed]
name: Add merged PR and linked issues to current milestone of target branch
jobs:
add-merged-to-current-milestone:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- id: get-current-milestone
run: |
echo ::set-output name=current_milestone::v$(head -1 CHANGELOG.md | cut -d " " -f 2)
- run: echo ${{ steps.get-current-milestone.outputs.current_milestone }}
- id: get-milestone-id
run: |
echo ::set-output name=milestone_id::$(curl -H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/milestones | jq 'map(select(.title == "${{ steps.get-current-milestone.outputs.current_milestone }}"))[0].number')
- run: echo ${{ steps.get-milestone-id.outputs.milestone_id }}
- uses: breathingdust/current-milestone-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pull_number: ${{ github.event.pull_request.number }}
milestone_number: ${{ steps.get-milestone-id.outputs.milestone_id }}