github.com/kyma-project/kyma-environment-broker@v0.0.1/scripts/publish_release.sh (about) 1 #!/usr/bin/env bash 2 3 # This script publishes a draft release 4 5 # standard bash error handling 6 set -o nounset # treat unset variables as an error and exit immediately. 7 set -o errexit # exit immediately when a command fails. 8 set -E # needs to be set if we want the ERR trap 9 set -o pipefail # prevents errors in a pipeline from being masked 10 11 RELEASE_ID=$1 12 13 REPOSITORY=${REPOSITORY:-kyma-project/kyma-environment-broker} 14 GITHUB_URL=https://api.github.com/repos/${REPOSITORY} 15 GITHUB_AUTH_HEADER="Authorization: Bearer ${GITHUB_TOKEN}" 16 17 CURL_RESPONSE=$(curl -L \ 18 -X POST \ 19 -H "Accept: application/vnd.github+json" \ 20 -H "${GITHUB_AUTH_HEADER}" \ 21 -H "X-GitHub-Api-Version: 2022-11-28" \ 22 ${GITHUB_URL}/releases/${RELEASE_ID} \ 23 -d '{"draft":false}')