Skip to content

Commit 2bd0cfc

Browse files
author
GitHub Actions
committed
chore: Update dist
1 parent 9b8de54 commit 2bd0cfc

File tree

2 files changed

+74
-14
lines changed

2 files changed

+74
-14
lines changed

dist/cleanup/index.js

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports =
5757
// We use any as a valid input type
5858
/* eslint-disable @typescript-eslint/no-explicit-any */
5959
Object.defineProperty(exports, "__esModule", { value: true });
60-
exports.toCommandValue = void 0;
60+
exports.toCommandProperties = exports.toCommandValue = void 0;
6161
/**
6262
* Sanitizes an input into a string so it can be passed into issueCommand safely
6363
* @param input input to sanitize into a string
@@ -72,6 +72,25 @@ function toCommandValue(input) {
7272
return JSON.stringify(input);
7373
}
7474
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;
7594
//# sourceMappingURL=utils.js.map
7695

7796
/***/ }),
@@ -308,7 +327,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
308327
});
309328
};
310329
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;
312331
const command_1 = __webpack_require__(431);
313332
const file_command_1 = __webpack_require__(102);
314333
const utils_1 = __webpack_require__(82);
@@ -486,19 +505,30 @@ exports.debug = debug;
486505
/**
487506
* Adds an error issue
488507
* @param message error issue message. Errors will be converted to string via toString()
508+
* @param properties optional properties to add to the annotation.
489509
*/
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);
492512
}
493513
exports.error = error;
494514
/**
495-
* Adds an warning issue
515+
* Adds a warning issue
496516
* @param message warning issue message. Errors will be converted to string via toString()
517+
* @param properties optional properties to add to the annotation.
497518
*/
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);
500521
}
501522
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;
502532
/**
503533
* Writes info to log with console.log.
504534
* @param message info message

dist/index.js

Lines changed: 37 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)