diff --git a/detection_rules/devtools.py b/detection_rules/devtools.py index 9caa81bd1..9dab06c67 100644 --- a/detection_rules/devtools.py +++ b/detection_rules/devtools.py @@ -132,11 +132,12 @@ def kibana_diff(rule_id, repo, branch, threads): @click.option("--kibana-directory", "-d", help="Directory to overwrite in Kibana", default="x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules") @click.option("--base-branch", "-b", help="Base branch in Kibana", default="master") +@click.option("--branch-name", "-n", help="Head branch for rules (default: package name)") @click.option("--ssh/--http", is_flag=True, help="Method to use for cloning") @click.option("--github-repo", "-r", help="Repository to use for the branch", default="elastic/kibana") @click.option("--message", "-m", help="Override default commit message") @click.pass_context -def kibana_commit(ctx, local_repo, github_repo, ssh, kibana_directory, base_branch, message): +def kibana_commit(ctx, local_repo, github_repo, ssh, kibana_directory, base_branch, branch_name, message): """Prep a commit and push to Kibana.""" git_exe = shutil.which("git") @@ -167,7 +168,7 @@ def kibana_commit(ctx, local_repo, github_repo, ssh, kibana_directory, base_bran git("checkout", base_branch) git("pull") - git("checkout", "-b", f"rules/{package_name}", show_output=True) + git("checkout", "-b", f"rules/{branch_name or package_name}", show_output=True) git("rm", "-r", kibana_directory) source_dir = os.path.join(release_dir, "rules")