@@ -134,7 +134,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
134
134
} ) ;
135
135
} ;
136
136
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
137
- exports . getState = exports . saveState = exports . group = exports . endGroup = exports . startGroup = exports . info = exports . warning = exports . error = exports . debug = exports . isDebug = exports . setFailed = exports . setCommandEcho = exports . setOutput = exports . getBooleanInput = exports . getMultilineInput = exports . getInput = exports . addPath = exports . setSecret = exports . exportVariable = exports . ExitCode = void 0 ;
137
+ exports . getState = exports . saveState = exports . group = exports . endGroup = exports . startGroup = exports . info = exports . notice = exports . warning = exports . error = exports . debug = exports . isDebug = exports . setFailed = exports . setCommandEcho = exports . setOutput = exports . getBooleanInput = exports . getMultilineInput = exports . getInput = exports . addPath = exports . setSecret = exports . exportVariable = exports . ExitCode = void 0 ;
138
138
const command_1 = __nccwpck_require__ ( 7351 ) ;
139
139
const file_command_1 = __nccwpck_require__ ( 717 ) ;
140
140
const utils_1 = __nccwpck_require__ ( 5278 ) ;
@@ -312,19 +312,30 @@ exports.debug = debug;
312
312
/**
313
313
* Adds an error issue
314
314
* @param message error issue message. Errors will be converted to string via toString()
315
+ * @param properties optional properties to add to the annotation.
315
316
*/
316
- function error ( message ) {
317
- command_1 . issue ( 'error' , message instanceof Error ? message . toString ( ) : message ) ;
317
+ function error ( message , properties = { } ) {
318
+ command_1 . issueCommand ( 'error' , utils_1 . toCommandProperties ( properties ) , message instanceof Error ? message . toString ( ) : message ) ;
318
319
}
319
320
exports . error = error ;
320
321
/**
321
- * Adds an warning issue
322
+ * Adds a warning issue
322
323
* @param message warning issue message. Errors will be converted to string via toString()
324
+ * @param properties optional properties to add to the annotation.
323
325
*/
324
- function warning ( message ) {
325
- command_1 . issue ( 'warning' , message instanceof Error ? message . toString ( ) : message ) ;
326
+ function warning ( message , properties = { } ) {
327
+ command_1 . issueCommand ( 'warning' , utils_1 . toCommandProperties ( properties ) , message instanceof Error ? message . toString ( ) : message ) ;
326
328
}
327
329
exports . warning = warning ;
330
+ /**
331
+ * Adds a notice issue
332
+ * @param message notice issue message. Errors will be converted to string via toString()
333
+ * @param properties optional properties to add to the annotation.
334
+ */
335
+ function notice ( message , properties = { } ) {
336
+ command_1 . issueCommand ( 'notice' , utils_1 . toCommandProperties ( properties ) , message instanceof Error ? message . toString ( ) : message ) ;
337
+ }
338
+ exports . notice = notice ;
328
339
/**
329
340
* Writes info to log with console.log.
330
341
* @param message info message
@@ -458,7 +469,7 @@ exports.issueCommand = issueCommand;
458
469
// We use any as a valid input type
459
470
/* eslint-disable @typescript-eslint/no-explicit-any */
460
471
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
461
- exports . toCommandValue = void 0 ;
472
+ exports . toCommandProperties = exports . toCommandValue = void 0 ;
462
473
/**
463
474
* Sanitizes an input into a string so it can be passed into issueCommand safely
464
475
* @param input input to sanitize into a string
@@ -473,6 +484,25 @@ function toCommandValue(input) {
473
484
return JSON . stringify ( input ) ;
474
485
}
475
486
exports . toCommandValue = toCommandValue ;
487
+ /**
488
+ *
489
+ * @param annotationProperties
490
+ * @returns The command properties to send with the actual annotation command
491
+ * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
492
+ */
493
+ function toCommandProperties ( annotationProperties ) {
494
+ if ( ! Object . keys ( annotationProperties ) . length ) {
495
+ return { } ;
496
+ }
497
+ return {
498
+ title : annotationProperties . title ,
499
+ line : annotationProperties . startLine ,
500
+ endLine : annotationProperties . endLine ,
501
+ col : annotationProperties . startColumn ,
502
+ endColumn : annotationProperties . endColumn
503
+ } ;
504
+ }
505
+ exports . toCommandProperties = toCommandProperties ;
476
506
//# sourceMappingURL=utils.js.map
477
507
478
508
/***/ } ) ,
@@ -6794,10 +6824,14 @@ const getMergeMethod = () => {
6794
6824
return mergeMethods [ input ]
6795
6825
}
6796
6826
6827
+ const parseCommaSeparatedValue = ( value ) => {
6828
+ return value . split ( ',' ) . map ( el => el . trim ( ) ) ;
6829
+ }
6830
+
6797
6831
exports . getInputs = ( ) => ( {
6798
6832
GITHUB_TOKEN : core . getInput ( 'github-token' , { required : true } ) ,
6799
6833
MERGE_METHOD : getMergeMethod ( ) ,
6800
- EXCLUDE_PKGS : core . getInput ( 'exclude' ) || [ ] ,
6834
+ EXCLUDE_PKGS : parseCommaSeparatedValue ( core . getInput ( 'exclude' ) ) || [ ] ,
6801
6835
MERGE_COMMENT : core . getInput ( 'merge-comment' ) || '' ,
6802
6836
APPROVE_ONLY : / t r u e / i. test ( core . getInput ( 'approve-only' ) ) ,
6803
6837
API_URL : core . getInput ( 'api-url' ) ,
0 commit comments