@@ -57,7 +57,7 @@ module.exports =
57
57
// We use any as a valid input type
58
58
/* eslint-disable @typescript-eslint/no-explicit-any */
59
59
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
60
- exports . toCommandValue = void 0 ;
60
+ exports . toCommandProperties = exports . toCommandValue = void 0 ;
61
61
/**
62
62
* Sanitizes an input into a string so it can be passed into issueCommand safely
63
63
* @param input input to sanitize into a string
@@ -72,6 +72,25 @@ function toCommandValue(input) {
72
72
return JSON . stringify ( input ) ;
73
73
}
74
74
exports . toCommandValue = toCommandValue ;
75
+ /**
76
+ *
77
+ * @param annotationProperties
78
+ * @returns The command properties to send with the actual annotation command
79
+ * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
80
+ */
81
+ function toCommandProperties ( annotationProperties ) {
82
+ if ( ! Object . keys ( annotationProperties ) . length ) {
83
+ return { } ;
84
+ }
85
+ return {
86
+ title : annotationProperties . title ,
87
+ line : annotationProperties . startLine ,
88
+ endLine : annotationProperties . endLine ,
89
+ col : annotationProperties . startColumn ,
90
+ endColumn : annotationProperties . endColumn
91
+ } ;
92
+ }
93
+ exports . toCommandProperties = toCommandProperties ;
75
94
//# sourceMappingURL=utils.js.map
76
95
77
96
/***/ } ) ,
@@ -308,7 +327,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
308
327
} ) ;
309
328
} ;
310
329
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
311
- 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 ;
330
+ 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 ;
312
331
const command_1 = __webpack_require__ ( 431 ) ;
313
332
const file_command_1 = __webpack_require__ ( 102 ) ;
314
333
const utils_1 = __webpack_require__ ( 82 ) ;
@@ -486,19 +505,30 @@ exports.debug = debug;
486
505
/**
487
506
* Adds an error issue
488
507
* @param message error issue message. Errors will be converted to string via toString()
508
+ * @param properties optional properties to add to the annotation.
489
509
*/
490
- function error ( message ) {
491
- command_1 . issue ( 'error' , message instanceof Error ? message . toString ( ) : message ) ;
510
+ function error ( message , properties = { } ) {
511
+ command_1 . issueCommand ( 'error' , utils_1 . toCommandProperties ( properties ) , message instanceof Error ? message . toString ( ) : message ) ;
492
512
}
493
513
exports . error = error ;
494
514
/**
495
- * Adds an warning issue
515
+ * Adds a warning issue
496
516
* @param message warning issue message. Errors will be converted to string via toString()
517
+ * @param properties optional properties to add to the annotation.
497
518
*/
498
- function warning ( message ) {
499
- command_1 . issue ( 'warning' , message instanceof Error ? message . toString ( ) : message ) ;
519
+ function warning ( message , properties = { } ) {
520
+ command_1 . issueCommand ( 'warning' , utils_1 . toCommandProperties ( properties ) , message instanceof Error ? message . toString ( ) : message ) ;
500
521
}
501
522
exports . warning = warning ;
523
+ /**
524
+ * Adds a notice issue
525
+ * @param message notice issue message. Errors will be converted to string via toString()
526
+ * @param properties optional properties to add to the annotation.
527
+ */
528
+ function notice ( message , properties = { } ) {
529
+ command_1 . issueCommand ( 'notice' , utils_1 . toCommandProperties ( properties ) , message instanceof Error ? message . toString ( ) : message ) ;
530
+ }
531
+ exports . notice = notice ;
502
532
/**
503
533
* Writes info to log with console.log.
504
534
* @param message info message
0 commit comments