Adjust script to work with Gitea Actions
ci/woodpecker/push/build Pipeline was successful Details

This commit is contained in:
Rafal Kupiec 2023-07-11 19:45:06 +02:00
parent b8cc7ede25
commit e9acb88e5b
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,12 @@ GITHUB_USERNAME="${1}"
GITHUB_TOKEN="${2}"
ASSET_NAME="${3}"
if [ ${GITHUB_ACTIONS} ] ; then
[ -z ${CI_COMMIT_SHA} ] && CI_COMMIT_SHA="${GITHUB_SHA}"
[ -z ${CI_COMMIT_TAG} ] && CI_COMMIT_TAG="${GITHUB_REF_NAME}"
[ -z ${CI_REPO} ] && CI_REPO="${GITHUB_REPOSITORY}"
fi
echo "Creating new GitHub release '${CI_COMMIT_TAG}'"
RESULT=$(curl --user "${GITHUB_USERNAME}:${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${CI_REPO}/releases -d \
"{