From 9bb0fd232468a9ace186bd1fbbf057fd00d38e5a Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Fri, 26 Feb 2021 20:17:32 +0100 Subject: [PATCH] =?UTF-8?q?Push=20tags=20by=20using=20=E2=80=94follow-tags?= =?UTF-8?q?=20and=20=E2=80=94atomic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0d11b03..8449b91 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -104,7 +104,7 @@ _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[@]}"}; else echo "::debug::git push origin"; git push origin ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"}; @@ -112,7 +112,7 @@ _push_to_github() { 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 }