mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2024-11-22 10:13:25 +01:00
Add ability to set the release title
This PR allows you the set/override the release title, which was set to the tag and still defaults to the tag.
This commit is contained in:
parent
a5aa633273
commit
b0876c539d
2 changed files with 7 additions and 2 deletions
|
@ -10,6 +10,8 @@ inputs:
|
||||||
description: 'owner/project relative to the URL'
|
description: 'owner/project relative to the URL'
|
||||||
tag:
|
tag:
|
||||||
description: 'Tag of the release'
|
description: 'Tag of the release'
|
||||||
|
title:
|
||||||
|
description: 'Title of the release (defaults to tag)'
|
||||||
sha:
|
sha:
|
||||||
description: 'SHA of the release'
|
description: 'SHA of the release'
|
||||||
token:
|
token:
|
||||||
|
@ -69,6 +71,8 @@ runs:
|
||||||
TAG=${TAG##refs/tags/}
|
TAG=${TAG##refs/tags/}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export TITLE="${{ inputs.title }}"
|
||||||
|
|
||||||
export DOWNLOAD_LATEST="${{ inputs.download-latest }}"
|
export DOWNLOAD_LATEST="${{ inputs.download-latest }}"
|
||||||
|
|
||||||
export PRERELEASE="${{ inputs.prerelease }}"
|
export PRERELEASE="${{ inputs.prerelease }}"
|
||||||
|
|
|
@ -7,6 +7,7 @@ if ${VERBOSE:-false}; then set -x; fi
|
||||||
|
|
||||||
: ${FORGEJO:=https://codeberg.org}
|
: ${FORGEJO:=https://codeberg.org}
|
||||||
: ${REPO:=forgejo-integration/forgejo}
|
: ${REPO:=forgejo-integration/forgejo}
|
||||||
|
: ${TITLE:=$TAG}
|
||||||
: ${RELEASE_DIR:=dist/release}
|
: ${RELEASE_DIR:=dist/release}
|
||||||
: ${DOWNLOAD_LATEST:=false}
|
: ${DOWNLOAD_LATEST:=false}
|
||||||
: ${TMP_DIR:=$(mktemp -d)}
|
: ${TMP_DIR:=$(mktemp -d)}
|
||||||
|
@ -47,11 +48,11 @@ upload_release() {
|
||||||
test ${releasetype+false} || echo "Uploading as Stable"
|
test ${releasetype+false} || echo "Uploading as Stable"
|
||||||
ensure_tag
|
ensure_tag
|
||||||
anchor=$(echo $TAG | sed -e 's/^v//' -e 's/[^a-zA-Z0-9]/-/g')
|
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
|
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"
|
echo "workaround v1.20 race condition https://codeberg.org/forgejo/forgejo/issues/1370"
|
||||||
sleep 10
|
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
|
else
|
||||||
cat $TMP_DIR/tea.log
|
cat $TMP_DIR/tea.log
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in a new issue