Skip to content

Commit

Permalink
add private mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasrodes committed Nov 27, 2024
1 parent 8759b27 commit fb06a43
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion apps/pr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
etl pr "some title for the PR"
# With a category
etl rp "some title for the PR" data
etl pr "some title for the PR" data
# With private stating server
etl pr "some title for the PR" --private
```
**Custom use case (1)**: Same as main use case, but with a specific branch name for the `work_branch`.
Expand Down Expand Up @@ -122,13 +125,20 @@
is_flag=True,
help="Directly create a PR from the current branch to the target branch (default: master).",
)
@click.option(
"--private",
"-p",
is_flag=True,
help="By default, staging server site (not admin) will be publicly accessible. Use --private to have it private instead. This does not apply when using --direct mode.",
)
def cli(
title: str,
category: Optional[str],
scope: Optional[str],
work_branch: Optional[str],
base_branch: str,
direct: bool,
private: bool,
# base_branch: Optional[str] = None,
) -> None:
# Check that the user has set up a GitHub token.
Expand Down Expand Up @@ -163,6 +173,9 @@ def cli(

# Auto PR mode: Create a new branch from the base branch.
if not direct:
if private:
if not work_branch.endswith("-private"):
work_branch = f"{work_branch}-private"
branch_out(repo, base_branch, work_branch)

# Create PR
Expand Down

0 comments on commit fb06a43

Please sign in to comment.