Skip to content

Commit

Permalink
Validate if secret file exists otherwise startup hangs
Browse files Browse the repository at this point in the history
  • Loading branch information
Scriptkiddi committed Dec 28, 2024
1 parent 2c99002 commit a958d58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nixpkgs_merge_bot/webhook/secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

class WebhookSecret:
def __init__(self, secret: Path) -> None:
self.secret = secret.read_text().strip()
if secret.exists():
self.secret = secret.read_text().strip()
else:
raise FileNotFoundError

def validate_signature(self, body: bytes, headers: Message) -> bool:
# Get the signature from the payload
Expand Down

0 comments on commit a958d58

Please sign in to comment.