Skip to content
Snippets Groups Projects
Unverified Commit 7f422af7 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #8932 from Rylan12/tap-new-add-branch-option

tap-new: add option for branch name
parents c2970bde 6dec1755
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,12 @@ module Homebrew
switch "--no-git",
description: "Don't initialize a git repository for the tap."
flag "--pull-label",
flag "--pull-label=",
description: "Label name for pull requests ready to be pulled (default `pr-pull`)."
flag "--branch=",
description: "Initialize git repository with the specified branch name (default `main`)."
conflicts "--no-git", "--branch"
named 1
end
end
......@@ -27,6 +31,7 @@ module Homebrew
args = tap_new_args.parse
label = args.pull_label || "pr-pull"
branch = args.branch || "main"
tap_name = args.named.first
tap = Tap.fetch(tap_name)
......@@ -56,7 +61,7 @@ module Homebrew
name: brew test-bot
on:
push:
branches: master
branches: #{branch}
pull_request:
jobs:
test-bot:
......@@ -106,7 +111,7 @@ module Homebrew
- labeled
jobs:
pr-pull:
if: contains(github.event.pull_request.labels.*.name, #{label})
if: contains(github.event.pull_request.labels.*.name, '#{label}')
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
......@@ -125,6 +130,7 @@ module Homebrew
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ github.token }}
branch: #{branch}
- name: Delete branch
if: github.event.pull_request.head.repo.fork == false
......@@ -142,6 +148,7 @@ module Homebrew
safe_system "git", "init"
safe_system "git", "add", "--all"
safe_system "git", "commit", "-m", "Create #{tap} tap"
safe_system "git", "branch", "-m", branch
end
end
......
......@@ -1233,6 +1233,8 @@ Generate the template files for a new tap.
Don't initialize a git repository for the tap.
* `--pull-label`:
Label name for pull requests ready to be pulled (default `pr-pull`).
* `--branch`:
Initialize git repository with the specified branch name (default `main`).
### `test` [*`options`*] *`formula`*
......
......@@ -1712,6 +1712,10 @@ Don\'t initialize a git repository for the tap\.
\fB\-\-pull\-label\fR
Label name for pull requests ready to be pulled (default \fBpr\-pull\fR)\.
.
.TP
\fB\-\-branch\fR
Initialize git repository with the specified branch name (default \fBmain\fR)\.
.
.SS "\fBtest\fR [\fIoptions\fR] \fIformula\fR"
Run the test method provided by an installed formula\. There is no standard output or return code, but generally it should notify the user if something is wrong with the installed formula\.
.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment