Skip to content

Commit

Permalink
update-infra-deployments: improve pkey error msg
Browse files Browse the repository at this point in the history
Handle the cases of GITHUB_APP_KEY_PATH not set / set to a non-existent
file more gracefully.

Signed-off-by: Adam Cmiel <[email protected]>
  • Loading branch information
chmeliik committed Sep 17, 2024
1 parent d4a2376 commit eda826e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ spec:
def main():
key_path = os.environ['GITHUBAPP_KEY_PATH']
key_path = os.environ.get('GITHUBAPP_KEY_PATH')
if key_path is None:
raise ValueError("The GITHUBAPP_KEY_PATH environment variable is not set")
if not os.path.exists(key_path):
raise ValueError(f"The GITHUBAPP_KEY_PATH file ({key_path!r}) does not exist")
if os.environ.get('GITHUBAPP_APP_ID'):
app_id = os.environ['GITHUBAPP_APP_ID']
Expand Down

0 comments on commit eda826e

Please sign in to comment.