@@ -525,7 +525,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
525525 });
526526};
527527Object.defineProperty(exports, "__esModule", ({ value: true }));
528- 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;
528+ 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;
529529const command_1 = __nccwpck_require__(7351);
530530const file_command_1 = __nccwpck_require__(717);
531531const utils_1 = __nccwpck_require__(5278);
@@ -703,19 +703,30 @@ exports.debug = debug;
703703/**
704704 * Adds an error issue
705705 * @param message error issue message. Errors will be converted to string via toString()
706+ * @param properties optional properties to add to the annotation.
706707 */
707- function error(message) {
708- command_1.issue ('error', message instanceof Error ? message.toString() : message);
708+ function error(message, properties = {} ) {
709+ command_1.issueCommand ('error', utils_1.toCommandProperties(properties) , message instanceof Error ? message.toString() : message);
709710}
710711exports.error = error;
711712/**
712- * Adds an warning issue
713+ * Adds a warning issue
713714 * @param message warning issue message. Errors will be converted to string via toString()
715+ * @param properties optional properties to add to the annotation.
714716 */
715- function warning(message) {
716- command_1.issue ('warning', message instanceof Error ? message.toString() : message);
717+ function warning(message, properties = {} ) {
718+ command_1.issueCommand ('warning', utils_1.toCommandProperties(properties) , message instanceof Error ? message.toString() : message);
717719}
718720exports.warning = warning;
721+ /**
722+ * Adds a notice issue
723+ * @param message notice issue message. Errors will be converted to string via toString()
724+ * @param properties optional properties to add to the annotation.
725+ */
726+ function notice(message, properties = {}) {
727+ command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
728+ }
729+ exports.notice = notice;
719730/**
720731 * Writes info to log with console.log.
721732 * @param message info message
@@ -849,7 +860,7 @@ exports.issueCommand = issueCommand;
849860// We use any as a valid input type
850861/* eslint-disable @typescript-eslint/no-explicit-any */
851862Object.defineProperty(exports, "__esModule", ({ value: true }));
852- exports.toCommandValue = void 0;
863+ exports.toCommandProperties = exports. toCommandValue = void 0;
853864/**
854865 * Sanitizes an input into a string so it can be passed into issueCommand safely
855866 * @param input input to sanitize into a string
@@ -864,6 +875,25 @@ function toCommandValue(input) {
864875 return JSON.stringify(input);
865876}
866877exports.toCommandValue = toCommandValue;
878+ /**
879+ *
880+ * @param annotationProperties
881+ * @returns The command properties to send with the actual annotation command
882+ * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
883+ */
884+ function toCommandProperties(annotationProperties) {
885+ if (!Object.keys(annotationProperties).length) {
886+ return {};
887+ }
888+ return {
889+ title: annotationProperties.title,
890+ line: annotationProperties.startLine,
891+ endLine: annotationProperties.endLine,
892+ col: annotationProperties.startColumn,
893+ endColumn: annotationProperties.endColumn
894+ };
895+ }
896+ exports.toCommandProperties = toCommandProperties;
867897//# sourceMappingURL=utils.js.map
868898
869899/***/ }),
0 commit comments