-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
Thoughts on supporting case insensitivity out of the box OR adding it as an input?
https://github.com/mheap/github-action-required-labels/blob/main/index.js#L93C7-L93C77
- const appliedLabels = labels.map((label) => label.name);
+ const appliedLabels = labels.map((label) => label.name);
+ const lowerCaseAppliedLabels = appliedLabels.map((label) => label.toLowerCase());
- intersection = providedLabels.filter((x) => appliedLabels.includes(x))
+ intersection = providedLabels.filter((x) => lowerCaseAppliedLabels.includes(x.toLowerCase()))
The use case here is that we want to use this in a composite across repos but some repos have a "Do Not Merge" label spelled in different ways. In order to appropriately handle this, we have to do something like:
- uses: mheap/github-action-required-labels@fab3b73a9443656a796639b75fe08d4eb8c75e75
with:
mode: exactly
count: 0
labels: "DO NOT MERGE, Do Not Merge, Do not merge, do not merge"
add_comment: true
But that's obviously got a little bit of a smell to it, and the comment that get's posted isn't ideal.
Metadata
Metadata
Assignees
Labels
No labels