-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (37 loc) · 1.11 KB
/
create-tag-release.yml
File metadata and controls
44 lines (37 loc) · 1.11 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
39
40
41
42
43
44
name: Release on Tag
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
name: Generate Release
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get previous tag
id: previousTag
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v4.1.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{ env.previousTag }}
base-ref: ${{ github.ref_name }}
- name: Create Release
uses: ncipollo/release-action@v1.12.0
with:
draft: true
token: ${{ github.token }}
name: "Release ${{ github.ref_name }}"
body: "## Release Notes\n\nTODO\n\n## Commits\n\n${{ steps.changelog.outputs.changelog }}"