Skip to content

Commit f83f2dd

Browse files
Update github_rest_api/github.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent ba5d1b6 commit f83f2dd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

github_rest_api/github.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ def create_or_update_secret(
506506
raise ValueError("A string value is required for `name`.")
507507
if not isinstance(value, str):
508508
raise ValueError("A string value is required for `value`.")
509+
if visibility not in ("all", "private", "selected"):
510+
raise ValueError("`visibility` must be one of 'all', 'private', or 'selected'.")
511+
if selected_repository_ids and visibility != "selected":
512+
raise ValueError("`selected_repository_ids` can only be provided when `visibility` is 'selected'.")
509513
key = self.get_secret_public_key()
510514
json: dict[str, Any] = {
511515
"encrypted_value": _encrypt_secret(key["key"], value),

0 commit comments

Comments
 (0)