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

Some regex not working in filter via property #50

Closed
mytrancoinhako opened this issue Oct 5, 2022 · 4 comments
Closed

Some regex not working in filter via property #50

mytrancoinhako opened this issue Oct 5, 2022 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mytrancoinhako
Copy link

mytrancoinhako commented Oct 5, 2022

i need to filter some changed files in specific directory but the applied regex not working even I tested on https://regex101.com/

  • label: "payment"
    files:
    • "feature/wallet/.*"

- "(.*?)\/(addressbook|travelrules|walletsigning)\/.*"

@Mar0xy
Copy link

Mar0xy commented Oct 12, 2022

I am having the same issue and it only happens on the files property

@philippwaller
Copy link
Contributor

@mytrancoinhako, @Mar0xy: As this GitHub Action is written in Go (Golang), handling regular expressions (Regex) requires a bit of extra care. Specifically, you'll need to escape special characters using double backslashes. This is because the backslash in Go strings is an escape character and therefore must be escaped itself.
Here's an example that should work:

- label: "File"
  files:
    - ".*\\/subfolder\\/.*\\.md"

To clarify this, I've submitted PR (#129) that updates the documentation accordingly.

@srvaroa
Copy link
Owner

srvaroa commented Dec 19, 2023

Thanks @philippwaller , a while back I added this note to the docs on this topic, it has a link to https://regex101.com with the golang flavour which is needed to match the behaviour in the action. The tests and docs update made by @philippwaller should make this clearer.

I will close this issue for now but let me know if the issue is solved for you.

@jrfnl
Copy link

jrfnl commented Dec 19, 2023

Related to/duplicate of #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants