Skip to content

Commit 96fa552

Browse files
committed
test
1 parent 4d933c9 commit 96fa552

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

.github/workflows/tests.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -130,34 +130,33 @@ jobs:
130130
ref = '${{ github.ref }}';
131131
}
132132
133-
// Fetch all cache entries for the repository
134-
const caches = await github.paginate(github.rest.actions.getActionsCacheList, {
135-
owner: context.repo.owner,
136-
repo: context.repo.repo,
137-
per_page: 100,
138-
ref: ref
139-
});
140-
141-
console.log(caches);
142-
143-
if (caches.data) {
144-
console.log(`Found ${caches.data.actions_caches.length} caches.`);
145-
146-
// Delete matching caches
147-
for (const cache of matchingCaches) {
148-
if (cache.key.endsWith(sha)) {
149-
console.log(`Skipping cache with key: ${cache.key}`);
150-
continue;
151-
} else {
152-
console.log(`Deleting cache with key: ${cache.key}`);
133+
do {
134+
// Fetch all cache entries for the repository
135+
const caches = await github.rest.actions.getActionsCacheList({
136+
owner: context.repo.owner,
137+
repo: context.repo.repo,
138+
per_page: 100,
139+
ref: ref
140+
});
141+
142+
if (caches.data) {
143+
// Delete matching caches
144+
for (const cache of matchingCaches) {
145+
if (cache.key.endsWith(sha)) {
146+
console.log(`Skipping cache with key: ${cache.key}`);
147+
continue;
148+
} else {
149+
console.log(`Deleting cache with key: ${cache.key}`);
150+
}
151+
152+
/*
153+
await github.rest.actions.deleteActionsCacheById({
154+
owner: context.repo.owner,
155+
repo: context.repo.repo,
156+
cache_id: cache.id
157+
});
158+
*/
153159
}
154-
155-
/*
156-
await github.rest.actions.deleteActionsCacheById({
157-
owner: context.repo.owner,
158-
repo: context.repo.repo,
159-
cache_id: cache.id
160-
});
161-
*/
162-
}
160+
await sleep(30000); // Sleep for 30 seconds to avoid rate limiting
161+
} while(caches?.data?.actions_caches?.length > 0);
163162
}

0 commit comments

Comments
 (0)