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

Support skipLabels that contain forward slash #254

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

AverageMarcus
Copy link
Contributor

The skipLabels currently splits labels that contain / into multiple labels so skip/changelog becomes skip, changelog. This change fixes that so that a single skip/changelog (for example) label can be used.

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
@github-actions
Copy link

Preview of Release Notes to be Created

Chnaged

  • Switches the default branch from master to main

Dependencies

Copy link
Owner

@dangoslen dangoslen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Just would like to update the comment around the regex to point out that / now matches


it('should handle labels containing a forward slash', () => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏼

@@ -2,7 +2,7 @@ module.exports.extractLabels = function (labelsString) {
// Parses a list of labels. Each label can be of any length and will either end with a comma or be the end of the string.
// Matches words (\w), whitespace characters (\s), dashes (-), plus signs (+), questions marks (\?), semi-colons (;), brackets (\[\]) and parenthesis (\(\))
// Each match may are may not have a trailing comma (,?). If one exists, it is removed before appending it to the list
const regex = new RegExp(/([\w\s-+\?;\[\]\(\)]+,?)/, 'g')
const regex = new RegExp(/([\w\s-\/+\?;\[\]\(\)]+,?)/, 'g')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 Thank you.

Only thing is can we update the comment on line 3 to point out / now matches?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
@dangoslen
Copy link
Owner

Will merge and put this in the next release. Thinking a 3.5.0 since I don't see it as a patch but an improvement to support more label names

@dangoslen dangoslen merged commit e58e94b into dangoslen:main Jul 20, 2023
@AverageMarcus AverageMarcus deleted the handle_slash_label branch July 20, 2023 18:54
@dangoslen dangoslen added this to the v3.5.0 milestone Jul 20, 2023
@github-actions github-actions bot mentioned this pull request Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants