-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.99 KB
/
release-draft.yaml
File metadata and controls
61 lines (58 loc) · 1.99 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This file is @generated by <https://github.com/liblaf/copier-release>.
# DO NOT EDIT!
name: Release / Draft
on:
pull_request:
branches:
- main
types:
- closed
jobs:
release-draft:
name: Draft Release
permissions:
contents: write
if: startsWith(github.head_ref, 'release-please/') && github.event.pull_request.merged
runs-on: ubuntu-latest
environment:
name: Release Please
deployment: false
steps:
- id: auth
name: Auth
uses: liblaf/actions/auth@1f83732587ff97f1babbe9218fdc5436dda1a16f # v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
token: ${{ steps.auth.outputs.token }}
- id: version
name: Get version
run: |-
tag="$(awk '{ print $NF }' <<< "$TITLE")"
version="${tag#'v'}"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
env:
TITLE: ${{ github.event.pull_request.title }}
- name: Create tag
run: |-
git tag '${{ steps.version.outputs.tag }}'
git push origin tag '${{ steps.version.outputs.tag }}'
- id: immutable-releases
name: Check if immutable releases are enabled
run: |-
enabled="$(gh api '/repos/${{ github.repository }}/immutable-releases' --jq '.enabled')"
echo "enabled=$enabled" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.auth.outputs.token }}
continue-on-error: true
- name: Create release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
with:
body: ${{ github.event.pull_request.body }}
tag_name: ${{ steps.version.outputs.tag }}
draft: ${{ steps.immutable-releases.outputs.enabled == 'true' }}
token: ${{ steps.auth.outputs.token }}