From a794136ec2eca46bea31e921ad8980526716539f Mon Sep 17 00:00:00 2001 From: Santiago Bernhardt Date: Wed, 2 Nov 2022 09:17:32 +1300 Subject: [PATCH] go back to simple and use git tag git push --- entrypoint.sh | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 28dd1ac5..b3b6db9d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -238,36 +238,8 @@ then exit 0 fi -# create local git tag -git tag "$new" - -# push new tag ref to github -# this needs permissions in the workflow as contents: write -dt=$(date '+%Y-%m-%dT%H:%M:%SZ') -full_name=$GITHUB_REPOSITORY -git_refs_url=$(jq .repository.git_refs_url "$GITHUB_EVENT_PATH" | tr -d '"' | sed 's/{\/sha}//g') - echo "$dt: **pushing tag $new to repo $full_name" - -git_refs_response=$( -curl -s -X POST "$git_refs_url" \ --H "Authorization: token $GITHUB_TOKEN" \ --d @- << EOF - -{ - "ref": "refs/tags/$new", - "sha": "$commit" -} -EOF -) - -git_ref_posted=$( echo "${git_refs_response}" | jq .ref | tr -d '"' ) - -echo "::debug::${git_refs_response}" -if [ "${git_ref_posted}" = "refs/tags/${new}" ] -then - exit 0 -else - echo "::error::Tag was not created properly." - exit 1 -fi +# create local git tag +git tag -f "$new" +# push local tag +git push -f origin "$new" \ No newline at end of file