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

Corrects the regex examples for ignore-versions in the README.md #114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GMZwinge
Copy link

@GMZwinge GMZwinge commented Nov 1, 2023

No need to escape the \ in the regex examples. With the extra \, it deletes all but 3 package versions.

@GMZwinge GMZwinge requested a review from a team as a code owner November 1, 2023 22:21
@ruben-hoenle-fnt
Copy link

ruben-hoenle-fnt commented Feb 21, 2024

@GMZwinge sorry for the question, but how do you know that this is correct?

Currently I'm using the regex ^\\d+\\.\\d+$, and the action just deletes all version, even ones like 11.2, ...

If your PR is right it should work if I change my regex to ^\d+\.\d+$?

@kalinon
Copy link

kalinon commented Mar 13, 2024

I cant seem to get the ignore-versions option to work with container with either option.

@ruben-hoenle-fnt
Copy link

ruben-hoenle-fnt commented Mar 20, 2024

I cant seem to get the ignore-versions option to work with container with either option.

Same here, tried it with double backslashes in the regex and with single backslashes in the regex. This is very frustrating.

@GMZwinge
Copy link
Author

GMZwinge commented Mar 25, 2024

@ruben-hoenle-fnt From 7.3.2. Single-Quoted Style: The single-quoted style is specified by surrounding “'” indicators. Therefore, within a single-quoted scalar, such characters need to be repeated. This is the only form of escaping performed in single-quoted scalars. In particular, the “\” and “"” characters may be freely used. The double backslash results in that the action doesn't ignore anything because there is no version that matches the regex. A version matching your regex ^\\d+\\.\\d+$ would look like '\ddd\x\dddwheredcould be repeated any number of times andx` could be any character. See for example this test.

And yes, it should work with ^\d+\.\d+$ to ignore versions like 11.2.

@GMZwinge
Copy link
Author

@kalinon The issue with container may be due to ignore-versions doesn't seem to work with container packages (ghcr), not an issue with the regex.

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 this pull request may close these issues.

3 participants