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:
20
src/issue.ts
20
src/issue.ts
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ import * as github from '@actions/github'
|
||||
import stripAnsi from 'strip-ansi'
|
||||
import Octokit, {IssuesCreateResponse} from '@octokit/rest'
|
||||
import {Audit} from './audit'
|
||||
import * as issue from '../src/issue'
|
||||
import {IssueOption} from '../src/interface'
|
||||
import * as issue from './issue'
|
||||
import {IssueOption} from './interface'
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user