-
Notifications
You must be signed in to change notification settings - Fork 105
66 lines (56 loc) · 2.01 KB
/
close-milestone.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Close Milestone
on:
release:
types:
- released
jobs:
close_milestone:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
versionSpec: '0.15.x'
- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
# Ensure the milestone exists
- name: Create Milestone
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: v${{ steps.gitversion.outputs.majorMinorPatch }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
continue-on-error: true
# move any issues to that milestone in the event the release is renamed
- name: sync milestones
uses: RocketSurgeonsGuild/actions/[email protected]
with:
default-label: 'mysterious'
github-token: ${{ secrets.OMNISHARP_BOT_TOKEN }}
- name: Get Repo and Owner
shell: pwsh
id: repository
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
run: |
$parts = $ENV:GITHUB_REPOSITORY.Split('/')
echo "::set-output name=owner::$($parts[0])"
echo "::set-output name=repository::$($parts[1])"
- name: Close Milestone
shell: pwsh
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
run: |
dotnet gitreleasemanager close `
-o "${{ steps.repository.outputs.owner }}" `
-r "${{ steps.repository.outputs.repository }}" `
--token "${{ secrets.GITHUB_TOKEN }}" `
-m "v${{ steps.gitversion.outputs.majorMinorPatch }}"