-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (55 loc) · 1.97 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
name: Close Milestone
on:
release:
types:
- released
jobs:
close_milestone:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@master
with:
versionSpec: '5.x'
- name: Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@master
with:
versionSpec: '0.11.x'
- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@master
# Ensure the milestone exists
- name: Create Milestone
uses: WyriHaximus/github-action-create-milestone@0.1.0
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/sync-milestone@v0.2.4
with:
default-label: ':sparkles: mysterious'
github-token: ${{ secrets.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 }}"