Add atomic push
Since time elapses between the checkout the github workflow performs and the eventual push this action invokes the remote HEAD may have changed. If this is the case the HEAD update will be rejected but any tag (and their commits) will be pushed. In general I think this operation should be atomic, either we push everything or we push nothing. Force pushes still work the way you would expect (i.e. if we force the HEAD update with --atomic everything is still pushed) This also protects from the situation where someone else has seized your tag name in the meantime but not updated your HEAD. See git docs for more information - https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-atomic
This commit is contained in:
parent
9a46ba8d86
commit
bb3766ad6a
4
start.sh
4
start.sh
@ -43,8 +43,8 @@ fi
|
||||
git config --local --add safe.directory ${INPUT_DIRECTORY}
|
||||
|
||||
if ${INPUT_FORCE_WITH_LEASE}; then
|
||||
git push --follow-tags $_FORCE_OPTION $_TAGS;
|
||||
git push --atomic --follow-tags $_FORCE_OPTION $_TAGS;
|
||||
else
|
||||
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --verbose --follow-tags $_FORCE_OPTION $_TAGS;
|
||||
git push "${remote_repo}" HEAD:${INPUT_BRANCH} --atomic --verbose --follow-tags $_FORCE_OPTION $_TAGS;
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user