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

Allow multiple regexes for issue detection #326

Open
shimonelbaz opened this issue Dec 29, 2022 · 5 comments
Open

Allow multiple regexes for issue detection #326

shimonelbaz opened this issue Dec 29, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@shimonelbaz
Copy link

Is your feature request related to a problem? Please describe.
since Github allows multiple ways to link an issue to a PR, (direct reference , full reference , url) it could be nice to have multiple regexes as input in order to cover all options or if referencing to some external options.
it is also useful if you want to detect multiple dependencies / requirements.

Describe the solution you'd like
option to input multiple regexes (bonus: parameter to define if the result should consider an OR option between the results or an AND option - meaning , should any of the regexes match or all of them)

Describe alternatives you've considered
running the action multiple times in the same flow with different regex everytime and use some env variable to manage the results.

Additional context
N/A

@shimonelbaz shimonelbaz added the enhancement New feature or request label Dec 29, 2022
@mtfoley
Copy link
Owner

mtfoley commented Dec 29, 2022

@shimonelbaz thanks for filing this issue! I could see the appeal of having multiple regular expressions available to you, but I'm not sure I understand the use case of matching all regular expressions rather than any. In other words, why would a contributor need to specify linked issues in multiple formats? Let me know if you can elaborate on that use case.

@shimonelbaz
Copy link
Author

Hi,
I think that the usecase i have in mind is for instance when having a github issue and a jira ticket for using one for dev and one for support.

@mtfoley
Copy link
Owner

mtfoley commented Dec 29, 2022

OK, I follow you. If you'd prefer to contribute this feature in a PR, I can assign this issue to you. Otherwise, I'll keep you posted on this issue!

@shimonelbaz
Copy link
Author

If i will learn some typescript soon i will take it on myself, otherwise we can leave it to someone else for now.. :)

@mtfoley mtfoley self-assigned this Dec 31, 2022
@mtfoley
Copy link
Owner

mtfoley commented Dec 31, 2022

Hi @shimonelbaz I've got the feature drafted in a branch if you want to try it out.
https://github.com/mtfoley/pr-compliance-action/tree/multiple-body-regex
So with this branch the body-regex input is a multiline input, and the body-regex-match-all can be set to true to require all patterns to be matched (by default any match will pass the check).

body-regex: |
  (fixes|resolves) #\d+
  JIRA ABC-\d+
body-regex-match-all: true

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

No branches or pull requests

2 participants