feat(release): You can now set the gitea release as a draft and prerelease

This commit is contained in:
Nicolai Ort 2023-05-11 22:02:49 +02:00
parent 562a7542f3
commit 4f19015123
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
2 changed files with 10 additions and 1 deletions

View File

@ -12,6 +12,8 @@ Uses changelogen for changelog generation, is able to create gitea releases and
## Settings 🛠️
* `GITEA_DOMAIN`: Domain name of your gitea server - if not set release creation get's skipped
* `GITEA_APIKEY`: Api token for a gitea user that has the privileges to create releases in your repo
* `GITEA_DRAFT`: Mark gitea release as draft - defaults to false
* `GITEA_PRERELEASE`: Mark gitea release as prerelease - defaults to false
* `MATRIX_SERVER`: The matrix server's domain name - if not set notification sending get's skipped
* `MATRIX_USER`: The matrix user's username
* `MATRIX_PASSWORD`: The matrix user's password

View File

@ -39,6 +39,12 @@ if [ "${PLUGIN_GITEA_DOMAIN:+set}" = set ]; then
echo "Falling back to drone repo name";
PLUGIN_REPO=$CI_REPO_NAME
fi
if [ "${PLUGIN_GITEA_DRAFT:-null}" = null ]; then
PLUGIN_GITEA_DRAFT=false
fi
if [ "${PLUGIN_GITEA_PRERELEASE:-null}" = null ]; then
PLUGIN_GITEA_PRERELEASE=true
fi
curl --request POST \
--url "https://$PLUGIN_GITEA_DOMAIN/api/v1/repos/$PLUGIN_REPO/releases" \
@ -47,7 +53,8 @@ if [ "${PLUGIN_GITEA_DOMAIN:+set}" = set ]; then
--data "{
\"name\": \"$CURRENTTAG\",
\"body\": \"$ALLCHANGES\",
\"draft\": false,
\"draft\": $PLUGIN_GITEA_DRAFT,
\"prerelease\": $PLUGIN_GITEA_PRERELEASE,
\"tag_name\": \"$CURRENTTAG\"
}"
echo "Release created";