Creates an issue even if inputs.issue_labels is not given (#21)

* Creates an issue even if inputs.issue_labels is not given

* 1.0.0

* Use v1.0.0 in example, daily scan
This commit is contained in:
Naoki Oketani
2019-12-09 22:49:41 +09:00
committed by GitHub
parent be0cdcbe10
commit 2e5ad3c2cf
7 changed files with 20 additions and 16 deletions

View File

@@ -2,16 +2,20 @@ import * as core from '@actions/core'
import {IssueOption} from './interface'
export function getIssueOption(body: string): IssueOption {
let assignees
let labels
if (core.getInput('issue_assignees')) {
assignees = core.getInput('issue_assignees').replace(/\s+/g, '').split(',')
}
if (core.getInput('issue_labels')) {
labels = core.getInput('issue_labels').replace(/\s+/g, '').split(',')
}
return {
title: core.getInput('issue_title'),
body,
assignees: core
.getInput('issue_assignees')
.replace(/\s+/g, '')
.split(','),
labels: core
.getInput('issue_labels')
.replace(/\s+/g, '')
.split(',')
assignees,
labels
}
}