Merge pull request 'Add ability to set the release title' (#18) from paulvt/forgejo-release:set-release-title into main

Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/18
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
This commit is contained in:
earl-warren 2024-08-09 15:56:00 +00:00
commit 4cc83a59c5
2 changed files with 7 additions and 2 deletions

View file

@ -10,6 +10,8 @@ inputs:
description: 'owner/project relative to the URL'
tag:
description: 'Tag of the release'
title:
description: 'Title of the release (defaults to tag)'
sha:
description: 'SHA of the release'
token:
@ -69,6 +71,8 @@ runs:
TAG=${TAG##refs/tags/}
fi
export TITLE="${{ inputs.title }}"
export DOWNLOAD_LATEST="${{ inputs.download-latest }}"
export PRERELEASE="${{ inputs.prerelease }}"

View file

@ -7,6 +7,7 @@ if ${VERBOSE:-false}; then set -x; fi
: ${FORGEJO:=https://codeberg.org}
: ${REPO:=forgejo-integration/forgejo}
: ${TITLE:=$TAG}
: ${RELEASE_DIR:=dist/release}
: ${DOWNLOAD_LATEST:=false}
: ${TMP_DIR:=$(mktemp -d)}
@ -47,11 +48,11 @@ upload_release() {
test ${releasetype+false} || echo "Uploading as Stable"
ensure_tag
anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g')
if ! $BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype} >& $TMP_DIR/tea.log ; then
if ! $BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title "$TITLE" --draft ${releasetype} >& $TMP_DIR/tea.log ; then
if grep --quiet 'Unknown API Error: 500' $TMP_DIR/tea.log && grep --quiet services/release/release.go:194 $TMP_DIR/tea.log ; then
echo "workaround v1.20 race condition https://codeberg.org/forgejo/forgejo/issues/1370"
sleep 10
$BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title $TAG --draft ${releasetype}
$BIN_DIR/tea release create $assets --repo $REPO --note "$RELEASENOTES" --tag $TAG --title "$TITLE" --draft ${releasetype}
else
cat $TMP_DIR/tea.log
return 1