Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match is broken after switch to Regex #34

Closed
xlighting2017 opened this issue Sep 29, 2023 · 1 comment · Fixed by #35
Closed

match is broken after switch to Regex #34

xlighting2017 opened this issue Sep 29, 2023 · 1 comment · Fixed by #35

Comments

@xlighting2017
Copy link

the recent commit(1c5fa81) has changed the match from string match to regex, however, the match is broken:

the code:

return !item.draft && item.tag_name.match(deletePattern) !== -1 && item.assets.length > 0;

say, we have a item.tag_name = "abc", deletePattern = "123"

tag_name.match(deletePattern) will return null, and

item.tag_name.match(deletePattern) !== -1 will be true

which means: even if delete_tag_pattern does NOT match, it will delete the release!


below is the log indicating the above logic:

releases matching 360T7 will be targeted
🌶 given keep_min_download_counts is 0, this will not enable the download count removal rule
🌶 given delete_expired_data is 0
💬 found total of 3 active release(s)
🍻 found 1 older release(s)
starting to delete v23.9.28-ipq807x with id 122852717

smallprogram added a commit to smallprogram/delete-older-releases that referenced this issue Sep 29, 2023
thadguidry pushed a commit that referenced this issue Sep 29, 2023
* Fixed #26
* Fixed #32
* Fixed #34
* update readme
@smallprogram
Copy link
Contributor

please try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants