-
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.13 KB
/
release-drafter.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
name: 🚀 Release Drafter
on:
pull_request:
types:
- closed
jobs:
release-drafter:
name: Release Drafter
if: github.event.pull_request.merged == true && github.base_ref == 'main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: Draft release notes - ${{ github.head_ref }}
if: ${{ ! startsWith(github.head_ref, 'release/v') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: release-drafter/[email protected]
with:
config-name: release-drafter-config.yml
- name: Set env
if: ${{ startsWith(github.head_ref, 'release/v') }}
run: |
echo "RELEASE_VERSION=$(sed 's/release\/v//' <<< ${{ github.head_ref }})" >> "$GITHUB_ENV"
- name: Draft release notes - ${{ github.head_ref }}
if: ${{ startsWith(github.head_ref, 'release/v') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: release-drafter/[email protected]
with:
config-name: release-drafter-config.yml
version: ${{ env.RELEASE_VERSION }}