@@ -526,7 +526,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
526526 });
527527};
528528Object.defineProperty(exports, "__esModule", ({ value: true }));
529- 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;
529+ 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;
530530const command_1 = __nccwpck_require__(7351);
531531const file_command_1 = __nccwpck_require__(717);
532532const utils_1 = __nccwpck_require__(5278);
@@ -704,19 +704,30 @@ exports.debug = debug;
704704/**
705705 * Adds an error issue
706706 * @param message error issue message. Errors will be converted to string via toString()
707+ * @param properties optional properties to add to the annotation.
707708 */
708- function error(message) {
709- command_1.issue ('error', message instanceof Error ? message.toString() : message);
709+ function error(message, properties = {} ) {
710+ command_1.issueCommand ('error', utils_1.toCommandProperties(properties) , message instanceof Error ? message.toString() : message);
710711}
711712exports.error = error;
712713/**
713- * Adds an warning issue
714+ * Adds a warning issue
714715 * @param message warning issue message. Errors will be converted to string via toString()
716+ * @param properties optional properties to add to the annotation.
715717 */
716- function warning(message) {
717- command_1.issue ('warning', message instanceof Error ? message.toString() : message);
718+ function warning(message, properties = {} ) {
719+ command_1.issueCommand ('warning', utils_1.toCommandProperties(properties) , message instanceof Error ? message.toString() : message);
718720}
719721exports.warning = warning;
722+ /**
723+ * Adds a notice issue
724+ * @param message notice issue message. Errors will be converted to string via toString()
725+ * @param properties optional properties to add to the annotation.
726+ */
727+ function notice(message, properties = {}) {
728+ command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
729+ }
730+ exports.notice = notice;
720731/**
721732 * Writes info to log with console.log.
722733 * @param message info message
@@ -850,7 +861,7 @@ exports.issueCommand = issueCommand;
850861// We use any as a valid input type
851862/* eslint-disable @typescript-eslint/no-explicit-any */
852863Object.defineProperty(exports, "__esModule", ({ value: true }));
853- exports.toCommandValue = void 0;
864+ exports.toCommandProperties = exports. toCommandValue = void 0;
854865/**
855866 * Sanitizes an input into a string so it can be passed into issueCommand safely
856867 * @param input input to sanitize into a string
@@ -865,6 +876,25 @@ function toCommandValue(input) {
865876 return JSON.stringify(input);
866877}
867878exports.toCommandValue = toCommandValue;
879+ /**
880+ *
881+ * @param annotationProperties
882+ * @returns The command properties to send with the actual annotation command
883+ * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
884+ */
885+ function toCommandProperties(annotationProperties) {
886+ if (!Object.keys(annotationProperties).length) {
887+ return {};
888+ }
889+ return {
890+ title: annotationProperties.title,
891+ line: annotationProperties.startLine,
892+ endLine: annotationProperties.endLine,
893+ col: annotationProperties.startColumn,
894+ endColumn: annotationProperties.endColumn
895+ };
896+ }
897+ exports.toCommandProperties = toCommandProperties;
868898//# sourceMappingURL=utils.js.map
869899
870900/***/ }),
0 commit comments