diff --git a/README.md b/README.md index 97c3dab..e7dba1e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/plugin.sh b/plugin.sh index 424dfc9..416bd9e 100644 --- a/plugin.sh +++ b/plugin.sh @@ -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";