Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release.sh to bail on errors and detect git remote name #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samsonjs
Copy link

Using the shell options -e, -u, and -o pipefail is generally good hygiene to catch errors. I ran into this when bumping Ruby versions for the first time because I rename the "origin" remote to "github" in my local checkouts. That caused the script to fail when setting defaultBranch and it attempted to plow ahead anyway which is not desirable since the rest of the script makes commits and pushes them.

The other change is to detect the name of the git remote linked to the current branch when running release.sh, which is probably "main" most of the time. This will fail when the current branch isn't tracking an upstream branch yet so if that's a common case the current code here won't work. I understand if you'd rather not bother with that change and I'll revert it or find an alternative method that doesn't rely on having the current branch tracking an upstream one if you're open to that.

@samsonjs samsonjs requested a review from a team as a code owner April 23, 2024 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant