@@ -32,8 +32,8 @@ Tested on Ruby 3.0+
3232 * [ Changing the pre-release type] ( #changing-the-pre-release-type )
3333 * [ Creating the release after pre-releases] ( #creating-the-release-after-pre-releases )
3434 * [ After Running create-github-release] ( #after-running-create-github-release )
35+ * [ Reverting ` create-github-release ` ] ( #reverting-create-github-release )
3536* [ FAQ] ( #faq )
36- * [ What if I want to reverse the changes made by this script?] ( #what-if-i-want-to-reverse-the-changes-made-by-this-script )
3737 * [ How is the changelog updated?] ( #how-is-the-changelog-updated )
3838* [ Development] ( #development )
3939* [ Contributing] ( #contributing )
@@ -320,33 +320,28 @@ Finally, publish your gem to rubygems.org with the command:
320320rake release:rubygem_push
321321```
322322
323- ## FAQ
323+ ### Reverting ` create-github-release `
324324
325- ### What if I want to reverse the changes made by this script?
325+ Should you decide that ` create-github-release ` was run in error, the ` revert-github-release `
326+ script is provided by this gem to revert the changes made.
326327
327- You will need to delete the Git tag and branch created by this script both remotely and locally .
328+ This script must be run before the release PR is merged to the default branch .
328329
329- In your worktree run the following commands:
330+ This script must be run in the root directory of the work tree with the release
331+ branch checked out. This is the state that the ` create-github-release ` script leaves
332+ you in.
330333
331- ``` shell
332- DEFAULT_BRANCH=main
333- RELEASE_VERSION=1.0.1
334- RELEASE_TAG=" v${RELEASE_VERSION} "
335- RELEASE_BRANCH=" release_${RELEASE_TAG} "
336- REMOTE=origin
337-
338- # Make sure the release branch is not checked out
339- git checkout " ${DEFAULT_BRANCH} "
340-
341- # Delete remote branch and tag
342- # Deleting the remote branch will automatically close the release PR
343- git push " ${REMOTE} " --delete " ${RELEASE_BRANCH} "
344- git push " ${REMOTE} " --delete " ${RELEASE_TAG} "
345-
346- # Delete the local branch and tag
347- git branch -D " ${RELEASE_BRANCH} "
348- git tag -d " ${RELEASE_TAG} "
349- ```
334+ This script does the following:
335+
336+ * Adds a comment to the release PR noting that it will be reverted
337+ * Switches the work tree to the default branch so the release branch can be deleted
338+ * Deletes the local release branch and release tag
339+ * Deletes the remote release branch and release tag
340+ * Deletes the release object created in GitHub for this release
341+
342+ Deleting the release branch on the remote will automatically close the release PR.
343+
344+ ## FAQ
350345
351346### How is the changelog updated?
352347
0 commit comments