aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/@actions/core/lib/utils.js
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-12-11 15:42:38 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2022-12-11 15:42:38 +0100
commit9857fae4d1136ef2ebfeffaaaf6ba22e1015401a (patch)
tree8d88c98d2100e29b668df3845088565cde9d80c6 /node_modules/@actions/core/lib/utils.js
parentbump Node version (diff)
downloadcleanup-path-9857fae4d1136ef2ebfeffaaaf6ba22e1015401a.tar.gz
cleanup-path-9857fae4d1136ef2ebfeffaaaf6ba22e1015401a.zip
upgrade actions/core
Diffstat (limited to 'node_modules/@actions/core/lib/utils.js')
-rw-r--r--node_modules/@actions/core/lib/utils.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/@actions/core/lib/utils.js b/node_modules/@actions/core/lib/utils.js
index 97cea33..9b5ca44 100644
--- a/node_modules/@actions/core/lib/utils.js
+++ b/node_modules/@actions/core/lib/utils.js
@@ -2,6 +2,7 @@
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
+exports.toCommandProperties = exports.toCommandValue = void 0;
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
@@ -16,4 +17,24 @@ function toCommandValue(input) {
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
+/**
+ *
+ * @param annotationProperties
+ * @returns The command properties to send with the actual annotation command
+ * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
+ */
+function toCommandProperties(annotationProperties) {
+ if (!Object.keys(annotationProperties).length) {
+ return {};
+ }
+ return {
+ title: annotationProperties.title,
+ file: annotationProperties.file,
+ line: annotationProperties.startLine,
+ endLine: annotationProperties.endLine,
+ col: annotationProperties.startColumn,
+ endColumn: annotationProperties.endColumn
+ };
+}
+exports.toCommandProperties = toCommandProperties;
//# sourceMappingURL=utils.js.map \ No newline at end of file