Skip to content

Commit 30ff803

Browse files
authored
Clean up logic for skipping prev. poisoned entries. (#23)
1 parent e2a1bd0 commit 30ff803

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ async function main() {
333333
console.log(`Not attempting to clear entry as it already contains Cacheract.`);
334334
continue;
335335
}
336+
337+
if (key.includes("setup-python-Linux-24.04.1")) {
338+
console.log("Skipping cacheract entry to avoid re-poisoning self.");
339+
continue;
340+
}
336341

337342
if (clearEntryFailed) {
338343
if (currBranch === ref) {
@@ -356,16 +361,13 @@ async function main() {
356361
path = await createEntry(size);
357362
// Since we can no longer set arbitrary string version, we use
358363
// cacheract's default stuffing key so we don't keep re-deleting poisoning it.
359-
} else if (!key.includes("setup-python-Linux-24.04.1")) {
360-
// Entry is in default branch, retrieve it
364+
} else {
365+
// Entry is in default branch and we are adding to self.
361366
path = await retrieveEntry(key, version, accessToken);
362-
363367
if (!path) {
364368
console.log(`Failed to retrieve cache entry ${key}!`);
365369
continue;
366370
}
367-
} else {
368-
continue
369371
}
370372

371373
// Update the entry, whether we made one or retrieved it.

0 commit comments

Comments
 (0)