Allow multiple exempt labels#19
Conversation
| let exemptLabels = isPr ? args.exemptPrLabels : args.exemptIssueLabels; | ||
|
|
||
| if (exemptLabel && isLabeled(issue, exemptLabel)) { | ||
| if (exemptLabels.some(exemptLabel => isLabeled(issue, exemptLabel))) { |
There was a problem hiding this comment.
|
Awesome! Yes this is what I have in mind :) exempt-issue-labels:
- with team
- with boss
- lunch
- with client{
'exempt-issue-labels': [
'with team',
'with boss',
'lunch',
'with client'
]
} |
|
Oh yes please, we need this option! |
|
You won't be able to write it like this as an end-user: exempt-issue-labels:
- with team
- with boss
- lunch
- with clientBecause GitHub doesn't accept that as a valid format. You can use YAML and the exempt-labels: |
not stale
importantThen you need to parse the incoming labels: exemptLabels: parseLabels(core.getInput("exempt-labels"))To get an array of strings: // Since GitHub doesn't allow arrays in workflow files
// You need to use YAML and | pipe
// Therefore this function splits on new lines and creates an array
function parseLabels(files: string): string[] {
return files.split(/\r?\n/).reduce<string[]>(
(acc, line) =>
acc
.concat(line.split(","))
.filter(pat => pat)
.map(pat => pat.trim()),
[]
)
}I used that in our fork: gatsbyjs#1 |
|
@LekoArts thanks for the heads up, I wasn't aware of that limitation. In that case though, I'd probably default to using comma-separated values for the options instead of newline-separated with a pipe operator. I suspect that if we use the pipe operator to put it on multiple lines, users might infer that it's an array and prefix each line with a So I'd now imagine the exempt-issue-labels: foo,bar,bazSince this PR has remained un-reviewed for a little while, I'll wait until I've heard back from the owners about whether they'd like to accept this functionality before making the change to the PR. |
|
Looking forward to this in the next release! I don't think there will be an issue since the actions are versioned, e.g. I reference this action like this: uses: actions/stale@v1So as long as this is included in a "v2" for example, it shouldn't break anything existing. |
Yes, this seems like a good option since a comma is not a valid character in a label name and would make the parsing much simpler 👍 |
|
I do hope this becomes a thing soon!!! |
|
Eagerly awaiting this in actions/stale@v2 (or v1.1, or whichever!). |
|
Any eta for this? |
|
Any update on when this would potentially get merged and released? |
|
Not my call 🤷♂ |
|
@chrispat maybe you can shed some light on this? |
|
Really want to add this to a few repos but can't until multiple exempt labels are added - any updates?? |
|
As mentioned by me in another PR already: Feel free to use our (Gatsby) fork: |
Thanks, I will give it a try! It's somehow sad that GitHub (which owns this actions repository) doesn't look at PR on their own platforms. |
|
This repo is getting pretty stale and I'm taking it over to clean it up and get some of these suggestions merged. I like this one @ryanwilsonperkin if you want to add the comma parsing we can get it merged and pushed with the next release (soon). And yep @Gustry it's sad this repo got neglected for so long 😢 (but we will rehab it shortly). |
|
Hey @hross thanks for taking over! I'll push an update to switch this over to comma-parsing instead. |
033b6d0 to
620caa8
Compare
|
@ryanwilsonperkin Thanks for the quick turnaround! @hross Thanks for taking this over - really hoping to see a release very soon with this functionality in it! ❤️ |
|
this looks good if you want to resolve the conflicts I'll merge it. |
|
On it |
|
@ryanwilsonperkin yes you need to run |
|
(I'll update the readme with better instructions) |
|
@hross, can't wait for this to go in! |
Version 2 of actions/stale changed the option for exempt issue labels from the singular `exempt-issue-label` to the plural `exempt-issue-labels`. Refs: actions/stale#19 Refs: nodejs/build#2704
Version 2 of actions/stale changed the option for exempt issue labels from the singular `exempt-issue-label` to the plural `exempt-issue-labels`. Refs: actions/stale#19 Refs: nodejs/build#2704
From `actions/stale@v2` the option for exempt labels was renamed to `exempt-issue-labels` (plural). Also it appears that this repository is using `never-stale` (with a hyphen instead of a space character). Refs: actions/stale#19
From `actions/stale@v2` the option for exempt labels was renamed to `exempt-issue-labels` (plural). Also it appears that this repository is using `never-stale` (with a hyphen instead of a space character). Refs: actions/stale#19
From `actions/stale@v2` the option for exempt labels was renamed to `exempt-issue-labels` (plural). Also it appears that this repository is using `never-stale` (with a hyphen instead of a space character). Refs: actions/stale#19
Fixes #17
cc @skjnldsv as requester: Does this match what you were thinking?
Breaking change: This would switch the parameters from:
exempt-pr-label->exempt-pr-labelsexempt-issue-label->exempt-issue-labelsBy switching to a list syntax, we can still support a single "exempt" label (eg. at my company we just have a label called "pinned" that we would use to avoid being marked stale) but can now also support many different "exempt" labels.
Update (13/04/2020):
Because we can't use arrays as arguments to the action, this PR has been switched to use a comma-delimited string to indicate multiple labels.