Skip to content

[BUG]: RepositorySecretsClient & RepositoryVariablesClient GetAll() functions returns only the first page #3061

Description

@akordowski

What happened?

As the REST API documentation describes the endpoints for retrieving secrets and variables are paginated, but the GetAll() function in the RepositorySecretsClient and RepositoryVariablesClient don't utilizes this behaviour, The function returns only the first page, which is for the secrets default 30 and variables default 10 records per page.

[ManualRoute("GET", "/repos/{owner}/{repo}/actions/secrets")]
public Task<RepositorySecretsCollection> GetAll(string owner, string repoName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(repoName, nameof(repoName));
var url = ApiUrls.RepositorySecrets(owner, repoName);
return ApiConnection.Get<RepositorySecretsCollection>(url);
}

[ManualRoute("GET", "/repos/{owner}/{repo}/actions/variables")]
public Task<RepositoryVariablesCollection> GetAll(string owner, string repoName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(repoName, nameof(repoName));
var url = ApiUrls.RepositoryVariables(owner, repoName);
return ApiConnection.Get<RepositoryVariablesCollection>(url);
}

The expected behaviour would be to iterate over all pages and return all records, as described in the issues #3031 workaround.

Versions

Octokit.NET 14.0.0

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status
    🆕 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions