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

Improve mass-deploy process #22

Merged
merged 6 commits into from
Sep 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def mass_cli() -> None:
@mass_cli.command("deploy")
@click.option(
"-a",
"--actions",
"--actions_enable",
type=click.BOOL,
prompt="Enable GH Actions (to `selected`)?",
)
Expand Down Expand Up @@ -572,7 +572,7 @@ def mass_cli() -> None:
)
@click.option("-o", "--organization", prompt="Organization name", type=str)
def mass_deploy(
actions: bool,
actions_enable: bool,
secretscanner: bool,
pushprotection: bool,
dependabot: bool,
Expand All @@ -596,20 +596,25 @@ def mass_deploy(
template_codeql = f.read()

print(
f"Enabling Actions ({actions}), Secret Scanner ({secretscanner}), Push Protection ({pushprotection}), Dependabot ({dependabot}), CodeQL ({codeql}) to {len(repos_list)} repositories.",
end="",
f"Enabling Actions ({actions_enable}), Secret Scanner ({secretscanner}), Push Protection ({pushprotection}), Dependabot ({dependabot}), CodeQL ({codeql}) to {len(repos_list)} repositories."

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information

[Sensitive data (secret)](1) is logged here.
)

for repo in repos_list:

repo = repo.rstrip("\n")
issue_secretscanner_res = None
issue_pushprotection_res = None
issue_dependabot_res = None
issue_codeql_res = None
actions_res = None
secretscanner_res = None
pushprotection_res = None
dependabot_res = None
codeql_res = None

print("{repo}....", end="")
print(f"{repo}....", end="")

if actions:
if actions_enable:
actions_res = actions.set_permissions(
repository_name=repo,
organization=organization,
Expand Down