Skip to content

Commit e5b3733

Browse files
committed
prune pr tags as well
1 parent 04350f8 commit e5b3733

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/ghcr-prune.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
core.info(`Found ${versions.length} versions`);
7878
7979
const hashRegex = /^(?:sha256:)?[0-9a-f]{7,64}$/i;
80+
const prRegex = /^pr-\d+$/i;
8081
let deleted = 0;
8182
for (const version of versions) {
8283
const created = new Date(version.created_at).getTime();
@@ -94,8 +95,14 @@ jobs:
9495
identifiers.push(version.name);
9596
}
9697
98+
const hasReleaseTag = tags.some(tag => tag.startsWith('v'));
99+
if (hasReleaseTag) {
100+
continue;
101+
}
102+
97103
const hasCommitTag = identifiers.some(id => hashRegex.test(id));
98-
if (!hasCommitTag) {
104+
const hasPrTag = tags.some(tag => prRegex.test(tag));
105+
if (!hasCommitTag && !hasPrTag) {
99106
continue;
100107
}
101108

0 commit comments

Comments
 (0)