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
What happened?
As the REST API documentation describes the endpoints for retrieving secrets and variables are paginated, but the
GetAll()function in theRepositorySecretsClientandRepositoryVariablesClientdon'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.octokit.net/Octokit/Clients/RepositorySecretsClient.cs
Lines 49 to 58 in 7fa5b0f
octokit.net/Octokit/Clients/RepositoryVariablesClient.cs
Lines 49 to 58 in 7fa5b0f
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