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

publish-commit-bottles: specify branch and remote in git-try-push #126125

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

carlocab
Copy link
Member

Needed for #125556.

Closes Homebrew/actions#338.

@carlocab carlocab requested review from MikeMcQuaid and a team as code owners March 20, 2023 05:29
@carlocab carlocab added the CI-syntax-only Change only affects brew syntax, not the install. Only run syntax CI. label Mar 20, 2023
@BrewTestBot BrewTestBot added automerge-skip `brew pr-automerge` will skip this pull request workflows PR modifies GitHub Actions workflow files labels Mar 20, 2023
Comment on lines +114 to +121
branch="$(git branch --show-current)"
if [[ -n "$branch" ]]
then
echo "branch=$branch" >> "$GITHUB_OUTPUT"
else
echo "::error ::Not on a branch!"
exit 1
fi
Copy link
Member Author

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.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Member

@dawidd6 dawidd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@carlocab carlocab merged commit b7e5253 into Homebrew:master Mar 21, 2023
@carlocab carlocab deleted the branch-remote branch March 21, 2023 06:51
@carlocab
Copy link
Member Author

Shell scripts run in /bin/sh so we can't use bash-isms. #126214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge-skip `brew pr-automerge` will skip this pull request CI-syntax-only Change only affects brew syntax, not the install. Only run syntax CI. workflows PR modifies GitHub Actions workflow files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow git-try-push to push to PR branches.
5 participants