Skip to content

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

Merged
mheap merged 1 commit intomheap:mainfrom
codfish:case-insensitivity
Mar 20, 2024
Merged

feat: improve label matching by making it case-insensitive#76
mheap merged 1 commit intomheap:mainfrom
codfish:case-insensitivity

Conversation

@codfish
Copy link
Copy Markdown
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
Copy link
Copy Markdown
Contributor Author

codfish commented Mar 19, 2024

@mheap friendly bump

@mheap mheap merged commit 33f4833 into mheap:main Mar 20, 2024
@mheap
Copy link
Copy Markdown
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