Skip to content

Commit

Permalink
fix: update acceptable status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewthetechie committed Aug 3, 2022
1 parent 9530d6a commit bf7960c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions repo_manager/github/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def create_secret(repo: Repository, secret_name: str, unencrypted_value: str, is
status, headers, data = repo._requester.requestJson(
"PUT", f"{repo.url}/{secret_type}/secrets/{secret_name}", input=put_parameters
)
if status != 201:
raise Exception(f"Unable to create {secret_type} secret {status}")
return status == 201
if status not in (201, 204):
raise Exception(f"Unable to create {secret_type} secret. Status code: {status}")
return True


def delete_secret(repo: Repository, secret_name: str, is_dependabot: bool = False) -> bool:
Expand Down

0 comments on commit bf7960c

Please sign in to comment.