Skip to content

Commit

Permalink
Push tags by using —follow-tags and —atomic
Browse files Browse the repository at this point in the history
By using —follow-tags we push all annotated tags alongside the commit to the remote repository.
In addition, we’re using —atomic. This ensures that all refs are updated.

- https://github.blog/2015-04-30-git-2-4-atomic-pushes-push-to-deploy-and-more/#atomic-pushes
- https://stackoverflow.com/a/3745250
- https://therightstuff.medium.com/the-rights-and-wrongs-of-git-push-with-tags-998667eaed8f
  • Loading branch information
stefanzweifel committed Feb 26, 2021
1 parent 175c2cd commit 9bb0fd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ _push_to_github() {
if [ -n "$INPUT_TAGGING_MESSAGE" ]
then
echo "::debug::git push origin --tags";
git push origin --tags ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
git push origin --follow-tags --atomic ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};

This comment has been minimized.

Copy link
@Patreos998

Patreos998 Mar 2, 2021

´

else
echo "::debug::git push origin";
git push origin ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
fi

else
echo "::debug::Push commit to remote branch $INPUT_BRANCH";
git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
git push --set-upstream origin "HEAD:$INPUT_BRANCH" --follow-tags --atomic ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
fi
}

Expand Down

0 comments on commit 9bb0fd2

Please sign in to comment.