@@ -32,8 +32,8 @@ Tested on Ruby 3.0+
32
32
* [ Changing the pre-release type] ( #changing-the-pre-release-type )
33
33
* [ Creating the release after pre-releases] ( #creating-the-release-after-pre-releases )
34
34
* [ After Running create-github-release] ( #after-running-create-github-release )
35
+ * [ Reverting ` create-github-release ` ] ( #reverting-create-github-release )
35
36
* [ 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 )
37
37
* [ How is the changelog updated?] ( #how-is-the-changelog-updated )
38
38
* [ Development] ( #development )
39
39
* [ Contributing] ( #contributing )
@@ -320,33 +320,28 @@ Finally, publish your gem to rubygems.org with the command:
320
320
rake release:rubygem_push
321
321
```
322
322
323
- ## FAQ
323
+ ### Reverting ` create-github-release `
324
324
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.
326
327
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 .
328
329
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.
330
333
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
350
345
351
346
### How is the changelog updated?
352
347
0 commit comments