Suppression automatique d'une release gitea pré-existante
This commit is contained in:
parent
bcf34404a2
commit
356dc6d16c
|
@ -98,6 +98,12 @@ function create_release {
|
|||
payload=$(json_set "$payload" tag_name "\"${GITEA_RELEASE_VERSION:-$GITEA_RELEASE_COMMITISH_TARGET}\"")
|
||||
payload=$(json_set "$payload" target_commitish "\"$GITEA_RELEASE_COMMITISH_TARGET\"")
|
||||
|
||||
local existing_release=$(gitea_api "/repos/$GITEA_RELEASE_ORG/$GITEA_RELEASE_PROJECT/releases" -XGET | jq -e ".[] | select(.tag_name == \"${GITEA_RELEASE_VERSION}\") | .id")
|
||||
|
||||
if [ ! -z "${existing_release}" ]; then
|
||||
gitea_api "/repos/$GITEA_RELEASE_ORG/$GITEA_RELEASE_PROJECT/releases/${existing_release}" -XDELETE
|
||||
fi
|
||||
|
||||
gitea_api "/repos/$GITEA_RELEASE_ORG/$GITEA_RELEASE_PROJECT/releases" \
|
||||
-H "Content-Type:application/json" \
|
||||
-d "$payload"
|
||||
|
|
Loading…
Reference in New Issue