-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
publish-commit-bottles: specify branch and remote in git-try-push
#126125
Conversation
branch="$(git branch --show-current)" | ||
if [[ -n "$branch" ]] | ||
then | ||
echo "branch=$branch" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "::error ::Not on a branch!" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has an unhandled edge-case.
If the PR branch is also called master
(or otherwise conflicts with a branch name in the homebrew/core repo on the runner), then git branch --show-current
will return $username/master
, which will not work for the git-try-push
action below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Shell scripts run in |
Needed for #125556.
Closes Homebrew/actions#338.