Retrieve every page of secrets
This commit is contained in:
@@ -92,12 +92,13 @@ async function getRemoteSecrets(
|
|||||||
|
|
||||||
async function fetchSecrets(octokit: Octokit, owner: string, name: string): Promise<StringData[]> {
|
async function fetchSecrets(octokit: Octokit, owner: string, name: string): Promise<StringData[]> {
|
||||||
try {
|
try {
|
||||||
const response = await octokit.actions.listRepoSecrets({
|
return await octokit.paginate(octokit.actions.listRepoSecrets,
|
||||||
owner,
|
{
|
||||||
repo: name
|
owner,
|
||||||
});
|
repo: name,
|
||||||
|
per_page: 100
|
||||||
return response.data.secrets.map(secret => new StringData(secret.name));
|
},
|
||||||
|
response => response.data.map(secret => new StringData(secret.name)));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Failure to retrieve secrets: ", e);
|
console.log("Failure to retrieve secrets: ", e);
|
||||||
}
|
}
|
||||||
@@ -111,12 +112,13 @@ async function fetchEnvironmentSecrets(
|
|||||||
environmentName: string
|
environmentName: string
|
||||||
): Promise<StringData[]> {
|
): Promise<StringData[]> {
|
||||||
try {
|
try {
|
||||||
const response = await octokit.actions.listEnvironmentSecrets({
|
return await octokit.paginate(octokit.actions.listEnvironmentSecrets,
|
||||||
repository_id: repositoryId,
|
{
|
||||||
environment_name: environmentName
|
repository_id: repositoryId,
|
||||||
});
|
environment_name: environmentName,
|
||||||
|
per_page: 100
|
||||||
return response.data.secrets.map(secret => new StringData(secret.name));
|
},
|
||||||
|
response => response.data.map(secret => new StringData(secret.name)));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Failure to retrieve environment secrets: ", e);
|
console.log("Failure to retrieve environment secrets: ", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user