diff --git a/Library/Homebrew/dev-cmd/pr-automerge.rb b/Library/Homebrew/dev-cmd/pr-automerge.rb index c7aadd8ea1..047a94c503 100644 --- a/Library/Homebrew/dev-cmd/pr-automerge.rb +++ b/Library/Homebrew/dev-cmd/pr-automerge.rb @@ -34,7 +34,6 @@ module Homebrew def pr_automerge pr_automerge_args.parse - ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" unless OS.mac? without_labels = Homebrew.args.without_labels || ["do not merge", "new formula"] tap = Tap.fetch(Homebrew.args.tap || CoreTap.instance.name) @@ -59,7 +58,7 @@ module Homebrew end if args.publish? - safe_system "#{HOMEBREW_PREFIX}/bin/brew", "pr-publish", *pr_urls + safe_system HOMEBREW_BREW_FILE, "pr-publish", *pr_urls else ohai "Now run:", " brew pr-publish \\\n #{pr_urls.join " \\\n "}" end diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index d45ab8c185..899e2dee64 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -12,8 +12,10 @@ module Homebrew `pr-publish` [] [ ...] Publish bottles for a pull request with GitHub Actions. - Requires write access to the `homebrew/core` repository. + Requires write access to the repository. EOS + flag "--tap=", + description: "Target tap repository (default: `homebrew/core`)." switch :verbose min_named 1 end @@ -22,14 +24,13 @@ module Homebrew def pr_publish pr_publish_args.parse - ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" unless OS.mac? + tap = Tap.fetch(Homebrew.args.tap || CoreTap.instance.name) args.named.uniq.each do |arg| - arg = "#{CoreTap.instance.default_remote}/pull/#{arg}" if arg.to_i.positive? + arg = "#{tap.default_remote}/pull/#{arg}" if arg.to_i.positive? url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX _, user, repo, issue = *url_match odie "Not a GitHub pull request: #{arg}" unless issue - tap = Tap.fetch(user, repo) if repo.match?(HOMEBREW_OFFICIAL_REPO_PREFIXES_REGEX) ohai "Dispatching #{tap} pull request ##{issue}" GitHub.dispatch_event(user, repo, "Publish ##{issue}", pull_request: issue) end diff --git a/docs/Manpage.md b/docs/Manpage.md index 2709a17839..56c9b936af 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -883,7 +883,10 @@ Find pull requests that can be automatically merged using `brew pr-publish`. ### `pr-publish` [*`options`*] *`pull_request`* [*`pull_request`* ...] Publish bottles for a pull request with GitHub Actions. Requires write access to -the `homebrew/core` repository. +the repository. + +* `--tap`: + Target tap repository (default: `homebrew/core`). ### `pr-pull` [*`options`*] *`pull_request`* [*`pull_request`* ...] diff --git a/manpages/brew.1 b/manpages/brew.1 index a653c4df12..b56adc35ce 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1146,7 +1146,11 @@ Run \fBbrew pr\-publish\fR on matching pull requests\. Include pull requests that have failing status checks\. . .SS "\fBpr\-publish\fR [\fIoptions\fR] \fIpull_request\fR [\fIpull_request\fR \.\.\.]" -Publish bottles for a pull request with GitHub Actions\. Requires write access to the \fBhomebrew/core\fR repository\. +Publish bottles for a pull request with GitHub Actions\. Requires write access to the repository\. +. +.TP +\fB\-\-tap\fR +Target tap repository (default: \fBhomebrew/core\fR)\. . .SS "\fBpr\-pull\fR [\fIoptions\fR] \fIpull_request\fR [\fIpull_request\fR \.\.\.]" Download and publish bottles, and apply the bottle commit from a pull request with artifacts generated by GitHub Actions\. Requires write access to the repository\.