File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,16 +11,16 @@ GIT_REPO=$2
1111
1212CREATE_RELEASE_DATA=' {
1313 "tag_name": "' " ${GIT_TAG} " ' ",
14- "target_commitish": "master ",
14+ "target_commitish": "main ",
1515 "name": "' " ${GIT_TAG} " ' ",
1616 "body": "release-' " ${GIT_TAG} " ' ",
1717 "draft": false,
1818 "prerelease": false
1919 }'
2020
21- echo " Creating a new release: $GIT_TAG branch: master "
21+ echo " Creating a new release: $GIT_TAG branch: main "
2222
23- RESPONSE=$( curl -s --data " ${CREATE_RELEASE_DATA} " " https://api.github.com/repos/$GIT_REPO /releases?access_token= ${GITHUB_TOKEN} " )
23+ RESPONSE=$( curl -s --data " ${CREATE_RELEASE_DATA} " -H " Authorization: token ${GITHUB_TOKEN} " " https://api.github.com/repos/$GIT_REPO /releases" )
2424ASSET_UPLOAD_URL=$( echo " $RESPONSE " | jq -r .upload_url | cut -d ' {' -f1)
2525if [ -z " $ASSET_UPLOAD_URL " ]; then
2626 echo ${RESPONSE}
2929
3030for FILE in toCopy/* ; do
3131 echo " Uploading asset: $FILE to url: $ASSET_UPLOAD_URL ?name=${FILE} "
32- curl -s --data-binary @${FILE} -H " Content-Type: application/octet-stream" -X POST " $ASSET_UPLOAD_URL ?name=$( basename ${FILE} ) &access_token= ${GITHUB_TOKEN} "
32+ curl -s --data-binary @${FILE} -H " Content-Type: application/octet-stream" -H " Authorization: token ${GITHUB_TOKEN} " - X POST " $ASSET_UPLOAD_URL ?name=$( basename ${FILE} ) "
3333done
Original file line number Diff line number Diff line change 44GIT_REPO=$1
55
66echo " Getting latest release from $GIT_REPO "
7- RESP=$( curl -s " https://api.github.com/repos/$GIT_REPO /releases/latest?access_token= ${GITHUB_TOKEN} " )
7+ RESP=$( curl -s -H " Authorization: token ${GITHUB_TOKEN} " " https://api.github.com/repos/$GIT_REPO /releases/latest" )
88URLS=$( echo " $RESP " | jq -r .url)
9- if [ -z " ${URLS} " ]; then
9+ if [ " ${URLS} " ] && [ -z " ${URLS} " ]; then
1010 echo ${RESP}
1111 exit 1
1212fi
1313RELEASE_URL=(${URLS// / } )
1414
1515echo " Deleting old latest release"
16- RESPONSE=$( curl -s -X DELETE " ${RELEASE_URL} ?access_token= ${GITHUB_TOKEN }" )
16+ RESPONSE=$( curl -s -H " Authorization: token ${GITHUB_TOKEN} " - X DELETE " ${RELEASE_URL} " )
1717echo ${RESPONSE}
You can’t perform that action at this time.
0 commit comments