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

feat: improve label matching by making it case-insensitive #76

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

codfish
Copy link
Contributor

@codfish codfish commented Mar 13, 2024

Fixes #75

We leverage this action in a composite across multiple repos but some repos have a "Do Not Merge" label spelled in different ways. In order to appropriately handle this, we would have to do something like:

- uses: mheap/github-action-required-labels@v5
  with:
    mode: exactly
    count: 0
    labels: "DO NOT MERGE, Do Not Merge, Do not merge, do not merge"
    add_comment: true

This change makes it so you can provide just one of these labels and it will match regardless of casing.

I left it out of the regex matching cause that might get messy, however I could be misunderstanding the logic here. Are people able to pass in their own regex flags? And if not, do you think it would be safe for me to add the i flag in code here? I answered my own question after looking harder at the code and made the regex matching case-insensitive too. Please let me know if I'm wrong here!

@codfish codfish force-pushed the case-insensitivity branch 2 times, most recently from 2c49092 to 47b97d7 Compare March 13, 2024 18:47
@codfish
Copy link
Contributor Author

codfish commented Mar 19, 2024

@mheap friendly bump

@mheap mheap merged commit 33f4833 into mheap:main Mar 20, 2024
@mheap
Copy link
Owner

mheap commented Mar 20, 2024

Thank you for this! Triggering a release now

@codfish codfish deleted the case-insensitivity branch March 20, 2024 21:14
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.

Thoughts on supporting case insensitivity?
2 participants