Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jay2610 authored Dec 12, 2022
1 parent 6cc14b0 commit efb982d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,19 @@ const commonOpts = {

async function deleteOlderReleases(keepLatest) {
let releaseIdsAndTags = [];
let releaseIdsAndTagsData = [];
let page = 1;
let hasNextPage = true;
try {
while (hasNextPage) {
let res = await fetch({
const res = await fetch({
...commonOpts,
path: `/repos/${owner}/${repo}/releases?per_page=100&page=${page}`,
method: "GET",
});
if (!res.ok) {
throw new Error(`Error! status: ${response.status}`);
}
const { data } = await res.json();
if (data.length === 0) {
hasNextPage = false;
Expand Down

0 comments on commit efb982d

Please sign in to comment.