Visitar URL original
Org Actions secret/variable: cannot set selected repos; lazy secret selected_repositories fails · Issue #3530 · PyGithub/PyGithub · GitHub
Skip to content

Org Actions secret/variable: cannot set selected repos; lazy secret selected_repositories fails #3530

Open

Description

@Bolt4243

Two related issues in the organization Actions secret/variable selected-repository handling:

1. OrganizationVariable.edit() cannot set selected repositories

OrganizationVariable.edit() has no way to pass selected_repository_ids, so a variable cannot be updated to visibility="selected" with a repository list (unlike Organization.create_variable).

2. OrganizationSecret.selected_repositories breaks for lazily loaded secrets

The selected_repositories property reads self._selected_repositories_url.value directly, bypassing lazy completion. For a lazily loaded secret (e.g. from get_secret), the URL attribute is NotSet/None, so the returned PaginatedList is built over a None URL and raises ValueError: Either firstUrl or graphql_query must be given on iteration.

secret = g.withLazy(True).get_organization("org").get_secret("name")
list(secret.selected_repositories)  # ValueError

Version

main

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions