-
Notifications
You must be signed in to change notification settings - Fork 12
39 lines (32 loc) · 1.13 KB
/
create-draft-release.yml
File metadata and controls
39 lines (32 loc) · 1.13 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
name: Create draft release
on:
workflow_call:
inputs:
plan:
required: true
type: string
jobs:
main:
runs-on: ubuntu-latest
env:
PLAN: ${{ inputs.plan }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Plan details
run: |
echo "Plan details: $PLAN"
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Create draft release
run: |
RELEASE_TAG=$(echo ${PLAN} | jq -r '.announcement_tag')
ANNOUNCEMENT_TITLE=$(echo ${PLAN} | jq -r '.announcement_title')
ANNOUNCEMENT_BODY=$(echo ${PLAN} | jq -r '.announcement_github_body')
# Write body to file to avoid quoting issues
echo "$ANNOUNCEMENT_BODY" > /tmp/release-notes.txt
echo "Creating draft release ${RELEASE_TAG}"
# The release will be undrafted by cargo-dist after it has uploaded the artifacts
gh release create "${RELEASE_TAG}" \
--draft \
--title "${ANNOUNCEMENT_TITLE}" \
--notes-file /tmp/release-notes.txt
echo "Release created successfully"