Skip to content

Commit

Permalink
Do not request Github environment variables when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Oct 30, 2023
1 parent 5849af5 commit ba8c979
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions dispatcher/backend/maint-scripts/report_youtube_api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@
def report_youtube_api_keys(session: so.Session, *, display_unknown_secrets=False):
jinja_env = Environment(loader=FileSystemLoader("./"), autoescape=True)
jinja_template = jinja_env.get_template("report_youtube_api_keys.txt")
github_repo = os.environ["GITHUB_REPO"]
github_token = os.environ["GITHUB_TOKEN"]
github_issue_assignees = os.environ.get("GITHUB_ISSUE_ASSIGNEES", "").split(",")
github_issue_labels = os.environ.get("GITHUB_ISSUE_LABELS", "").split(",")
create_issue = os.environ.get("CREATE_ISSUE", "false").lower() == "true"
github_repo = os.environ["GITHUB_REPO"] if create_issue else "nevermind"
github_token = os.environ["GITHUB_TOKEN"] if create_issue else "nevermind"
github_issue_assignees = (
os.environ.get("GITHUB_ISSUE_ASSIGNEES", "").split(",")
if create_issue
else "nevermind"
)
github_issue_labels = (
os.environ.get("GITHUB_ISSUE_LABELS", "").split(",")
if create_issue
else "nevermind"
)

known_api_keys = json.loads(
pathlib.Path("report_youtube_api_keys.conf.json").read_text()
Expand Down

0 comments on commit ba8c979

Please sign in to comment.