-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1.03 KB
/
create-github-release.yml
File metadata and controls
38 lines (32 loc) · 1.03 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
name: Create GitHub Release Draft
on: workflow_call
jobs:
release-draft-with-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previousTag
run: |
name=$(git --no-pager tag --sort=-v:refname --merged ${{ github.ref_name }} | sed -n 2,2p)
name=${name:=$(git rev-list --max-parents=0 HEAD)}
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: false
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ secrets.GITHUB_TOKEN }}