Skip to content

Commit 2e1544d

Browse files
committed
Create a release draft if none is found during release
Release draft not found is usually caused by mismatching target branch name: while release-drafter uses `refs/head/master`, `gh release` needs (or always used to need) `master` which needed to be edited manually on the GitHub Releases page. This change is a precaution so a release is published regardless the existence of release notes which can be always added later.
1 parent bfa6b65 commit 2e1544d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/release-management.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ jobs:
7979
env:
8080
GH_TOKEN: ${{ github.token }}
8181
GH_REPO: ${{ github.repository }}
82-
run: gh release edit "v${{ needs.test_and_build.outputs.version }}" --draft=false
82+
run: |
83+
if ! gh release view "v${{ needs.test_and_build.outputs.version }}" &>/dev/null;
84+
then gh release create "v${{ needs.test_and_build.outputs.version }}" --draft --title "v${{ needs.test_and_build.outputs.version }}";
85+
fi gh release edit "v${{ needs.test_and_build.outputs.version }}" --draft=false
8386
8487
- name: Write out the release URL
8588
run: echo "Released at $RELEASE_URL"

0 commit comments

Comments
 (0)