File tree 3 files changed +15
-7
lines changed
3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ export async function doCreateIssue(
74
74
75
75
export async function doCreateLabel ( ) {
76
76
const name = core . getInput ( 'label-name' ) ;
77
- const color = core . getInput ( 'label-color' ) || 'ededed' ;
78
- const description = core . getInput ( 'label-desc' ) || '' ;
77
+ const color = core . getInput ( 'label-color' ) ;
78
+ const description = core . getInput ( 'label-desc' ) ;
79
79
80
80
if ( name ) {
81
81
await ICE . createLabel ( name , color , description ) ;
Original file line number Diff line number Diff line change @@ -130,8 +130,8 @@ export class IssueCoreEngine implements IIssueCoreEngine {
130
130
131
131
public async createLabel (
132
132
labelName : string ,
133
- labelColor : string ,
134
- labelDescription : string | undefined ,
133
+ labelColor : string = 'ededed' ,
134
+ labelDescription : string = '' ,
135
135
) {
136
136
const { owner, repo, octokit } = this ;
137
137
await octokit . issues . createLabel ( {
@@ -318,11 +318,19 @@ export class IssueCoreEngine implements IIssueCoreEngine {
318
318
state : baseState ,
319
319
} = issue ;
320
320
321
- const baseLabelsName = baseLabels . map ( ( { name } : any ) => name ) ;
322
- const baseAssignessName = baseAssigness ?. map ( ( { login } : any ) => login ) ;
321
+ const baseLabelsName = baseLabels . map ( ( { name } ) => name ) ;
322
+ const baseAssignessName = baseAssigness ?. map ( ( { login } ) => login ) ;
323
323
324
324
const newBody = body ? ( mode === 'append' ? `${ baseBody } \n${ body } ` : body ) : baseBody ;
325
325
326
+ if ( labels && labels . length ) {
327
+ for ( const label of labels ) {
328
+ if ( baseLabelsName && baseLabelsName . length && baseLabelsName . indexOf ( label ) < 0 ) {
329
+ await this . createLabel ( label ) ;
330
+ }
331
+ }
332
+ }
333
+
326
334
await octokit . issues . update ( {
327
335
owner,
328
336
repo,
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export interface IIssueCoreEngine {
83
83
createIssueEmoji : ( emoji : TEmoji [ ] ) => Promise < void > ;
84
84
createLabel : (
85
85
labelName : string ,
86
- labelColor : string ,
86
+ labelColor : string | undefined ,
87
87
labelDescription : string | undefined ,
88
88
) => Promise < void > ;
89
89
You can’t perform that action at this time.
0 commit comments