Skip to content

Commit c898038

Browse files
authored
chore: add set milestone action (#108)
See [#401 - Automatically set milestone at issues when closed](open-component-model/ocm-project#401) for more information. Co-authored-by: ocmbot[bot] <125909804+ocmbot[bot]@users.noreply.github.com>
1 parent 29b0341 commit c898038

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/milestone.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Set milestone
2+
on:
3+
issues:
4+
types:
5+
- closed
6+
pull_request:
7+
types:
8+
- closed
9+
jobs:
10+
set_milestone:
11+
name: Set milestone
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
steps:
17+
- name: Set milestone on issue
18+
if: github.event.issue.state_reason == 'completed'
19+
run: gh issue edit ${{ github.event.issue.number }} --milestone "$(date +"%Y-Q%q")" --repo ${{ github.repository }}
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Set milestone on pull request
23+
if: github.event.pull_request.merged == true
24+
run: gh pr edit ${{ github.event.pull_request.number }} --milestone "$(date +"%Y-Q%q")" --repo ${{ github.repository }}
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)