Retain spaces within label (#95)
This commit is contained in:
@@ -41,6 +41,20 @@ describe('getIssueOption', () => {
|
||||
}
|
||||
expect(issue.getIssueOption('hi')).toEqual(expected)
|
||||
})
|
||||
|
||||
test('with label containing spaces', () => {
|
||||
process.env.INPUT_ISSUE_TITLE = 'npm audit found vulnerabilities'
|
||||
process.env.INPUT_ISSUE_ASSIGNEES = 'alice'
|
||||
process.env.INPUT_ISSUE_LABELS = 'status: ready, work: frontend'
|
||||
|
||||
const expected: IssueOption = {
|
||||
title: 'npm audit found vulnerabilities',
|
||||
body: 'hi',
|
||||
assignees: ['alice'],
|
||||
labels: ['status: ready', 'work: frontend']
|
||||
}
|
||||
expect(issue.getIssueOption('hi')).toEqual(expected)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getExistingIssueNumber', () => {
|
||||
|
||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -104,7 +104,7 @@ function getIssueOption(body) {
|
||||
assignees = core.getInput('issue_assignees').replace(/\s+/g, '').split(',');
|
||||
}
|
||||
if (core.getInput('issue_labels')) {
|
||||
labels = core.getInput('issue_labels').replace(/\s+/g, '').split(',');
|
||||
labels = core.getInput('issue_labels').split(',').map(label => label.trim());
|
||||
}
|
||||
return {
|
||||
title: core.getInput('issue_title'),
|
||||
|
||||
@@ -9,7 +9,7 @@ export function getIssueOption(body: string): IssueOption {
|
||||
assignees = core.getInput('issue_assignees').replace(/\s+/g, '').split(',')
|
||||
}
|
||||
if (core.getInput('issue_labels')) {
|
||||
labels = core.getInput('issue_labels').replace(/\s+/g, '').split(',')
|
||||
labels = core.getInput('issue_labels').split(',').map(label => label.trim())
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user