Skip to content

Commit 66afd41

Browse files
authoredSep 9, 2020
chore: add revert failed publish command (decaporg#4282)

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎.github/workflows/publish.yml

+1
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ jobs:
6666
CODE_PATTERN: 'Enter OTP'
6767
# 40 minutes for the entire command, 20 minutes for waiting for 2FA
6868
TIMEOUT: '2400000'
69+
REVERT_COMMAND: './scripts/revert_publish.sh'

‎scripts/revert_publish.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
publishCommit=$(git --no-pager log -1 --pretty=format:"%H" --grep="^chore(release): publish$")
2+
ref=$(git tag -l --points-at $publishCommit)
3+
echo "reverting publish commit $publishCommit"
4+
echo "deleting tags $ref"
5+
git push --delete origin $ref
6+
echo "reverting commit $publishCommit"
7+
git revert --no-edit $publishCommit
8+
echo "pushing changes"
9+
git push origin master
10+
echo "done reverting publish"

0 commit comments

Comments
 (0)
Please sign in to comment.