chore: add revert failed publish command (#4282)

This commit is contained in:
Erez Rokah 2020-09-09 05:11:56 -07:00 committed by GitHub
parent 512e6370b2
commit 66afd413c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -66,3 +66,4 @@ jobs:
CODE_PATTERN: 'Enter OTP'
# 40 minutes for the entire command, 20 minutes for waiting for 2FA
TIMEOUT: '2400000'
REVERT_COMMAND: './scripts/revert_publish.sh'

10
scripts/revert_publish.sh Executable file
View File

@ -0,0 +1,10 @@
publishCommit=$(git --no-pager log -1 --pretty=format:"%H" --grep="^chore(release): publish$")
ref=$(git tag -l --points-at $publishCommit)
echo "reverting publish commit $publishCommit"
echo "deleting tags $ref"
git push --delete origin $ref
echo "reverting commit $publishCommit"
git revert --no-edit $publishCommit
echo "pushing changes"
git push origin master
echo "done reverting publish"