Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from ReenigneArcher/patch-1
Browse files Browse the repository at this point in the history
fix: remove has assets condition
  • Loading branch information
thadguidry authored May 20, 2024
2 parents b910cf2 + 7aee8e4 commit 28771f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,20 @@ flowchart TD
02[Get github all releases]
03[Filter pre-release data]
04[Filter delete_tag_pattern]
05[Filter assets length > 0]
06[Sort data by date]
07[Filter keep latest]
08[Filter keep keepMinDownloadCount]
09[Filter deleteExpiredData]
10[Delete old release and tag]
05[Sort data by date]
06[Filter keep latest]
07[Filter keep keepMinDownloadCount]
08[Filter deleteExpiredData]
09[Delete old release and tag]
01 --> 02
02 -.-> 03
02 -.-> 04
03 --> 05
04 --> 05
05 --> 06
06 --> 07
07 -.-> 08
07 -.-> 09
09 --> 10
08 --> 10
06 -.-> 07
06 -.-> 08
07 --> 09
08 --> 09
```
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ async function deleteOlderReleases(keepLatest, keepMinDownloadCount, deleteExpir
const activeMatchedReleases = data.filter((item) => {
if (deletePrereleaseOnly) {
if (deletePatternStr) {
return !item.draft && item.assets.length > 0 && item.prerelease && item.tag_name.match(deletePattern);
return !item.draft && item.prerelease && item.tag_name.match(deletePattern);
} else {
return !item.draft && item.assets.length > 0 && item.prerelease;
return !item.draft && item.prerelease;
}
} else {
if (deletePatternStr) {
return !item.draft && item.assets.length > 0 && item.tag_name.match(deletePattern);
return !item.draft && item.tag_name.match(deletePattern);
} else {
return !item.draft && item.assets.length > 0;
return !item.draft;
}
}
})
Expand Down

0 comments on commit 28771f0

Please sign in to comment.