Skip to content

Commit 0ca8b4b

Browse files
authored
Update yarn packages (#31)
1 parent 16b11ab commit 0ca8b4b

File tree

4 files changed

+891
-996
lines changed

4 files changed

+891
-996
lines changed

.github/workflows/slack-notification-with-optional-parameters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
steps:
1111
- name: Send Slack Message
12-
uses: archive/github-actions-slack@v2.1.0
12+
uses: archive/github-actions-slack@master
1313
id: send-message
1414
with:
1515
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}

dist/index.js

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
134134
});
135135
};
136136
Object.defineProperty(exports, "__esModule", ({ value: true }));
137-
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.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
137+
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;
138138
const command_1 = __nccwpck_require__(351);
139139
const file_command_1 = __nccwpck_require__(717);
140140
const utils_1 = __nccwpck_require__(278);
@@ -220,6 +220,21 @@ function getInput(name, options) {
220220
return val.trim();
221221
}
222222
exports.getInput = getInput;
223+
/**
224+
* Gets the values of an multiline input. Each value is also trimmed.
225+
*
226+
* @param name name of the input to get
227+
* @param options optional. See InputOptions.
228+
* @returns string[]
229+
*
230+
*/
231+
function getMultilineInput(name, options) {
232+
const inputs = getInput(name, options)
233+
.split('\n')
234+
.filter(x => x !== '');
235+
return inputs;
236+
}
237+
exports.getMultilineInput = getMultilineInput;
223238
/**
224239
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
225240
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
@@ -297,19 +312,30 @@ exports.debug = debug;
297312
/**
298313
* Adds an error issue
299314
* @param message error issue message. Errors will be converted to string via toString()
315+
* @param properties optional properties to add to the annotation.
300316
*/
301-
function error(message) {
302-
command_1.issue('error', message instanceof Error ? message.toString() : message);
317+
function error(message, properties = {}) {
318+
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
303319
}
304320
exports.error = error;
305321
/**
306-
* Adds an warning issue
322+
* Adds a warning issue
307323
* @param message warning issue message. Errors will be converted to string via toString()
324+
* @param properties optional properties to add to the annotation.
308325
*/
309-
function warning(message) {
310-
command_1.issue('warning', message instanceof Error ? message.toString() : message);
326+
function warning(message, properties = {}) {
327+
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
311328
}
312329
exports.warning = warning;
330+
/**
331+
* Adds a notice issue
332+
* @param message notice issue message. Errors will be converted to string via toString()
333+
* @param properties optional properties to add to the annotation.
334+
*/
335+
function notice(message, properties = {}) {
336+
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
337+
}
338+
exports.notice = notice;
313339
/**
314340
* Writes info to log with console.log.
315341
* @param message info message
@@ -443,7 +469,7 @@ exports.issueCommand = issueCommand;
443469
// We use any as a valid input type
444470
/* eslint-disable @typescript-eslint/no-explicit-any */
445471
Object.defineProperty(exports, "__esModule", ({ value: true }));
446-
exports.toCommandValue = void 0;
472+
exports.toCommandProperties = exports.toCommandValue = void 0;
447473
/**
448474
* Sanitizes an input into a string so it can be passed into issueCommand safely
449475
* @param input input to sanitize into a string
@@ -458,6 +484,25 @@ function toCommandValue(input) {
458484
return JSON.stringify(input);
459485
}
460486
exports.toCommandValue = toCommandValue;
487+
/**
488+
*
489+
* @param annotationProperties
490+
* @returns The command properties to send with the actual annotation command
491+
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
492+
*/
493+
function toCommandProperties(annotationProperties) {
494+
if (!Object.keys(annotationProperties).length) {
495+
return {};
496+
}
497+
return {
498+
title: annotationProperties.title,
499+
line: annotationProperties.startLine,
500+
endLine: annotationProperties.endLine,
501+
col: annotationProperties.startColumn,
502+
endColumn: annotationProperties.endColumn
503+
};
504+
}
505+
exports.toCommandProperties = toCommandProperties;
461506
//# sourceMappingURL=utils.js.map
462507

463508
/***/ }),
@@ -826,31 +871,31 @@ module.exports = { updateMessage };
826871
/***/ ((module) => {
827872

828873
"use strict";
829-
module.exports = require("fs");;
874+
module.exports = require("fs");
830875

831876
/***/ }),
832877

833878
/***/ 211:
834879
/***/ ((module) => {
835880

836881
"use strict";
837-
module.exports = require("https");;
882+
module.exports = require("https");
838883

839884
/***/ }),
840885

841886
/***/ 87:
842887
/***/ ((module) => {
843888

844889
"use strict";
845-
module.exports = require("os");;
890+
module.exports = require("os");
846891

847892
/***/ }),
848893

849894
/***/ 622:
850895
/***/ ((module) => {
851896

852897
"use strict";
853-
module.exports = require("path");;
898+
module.exports = require("path");
854899

855900
/***/ })
856901

@@ -889,7 +934,9 @@ module.exports = require("path");;
889934
/************************************************************************/
890935
/******/ /* webpack/runtime/compat */
891936
/******/
892-
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
937+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
938+
/******/
939+
/************************************************************************/
893940
var __webpack_exports__ = {};
894941
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
895942
(() => {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"deploy": "rm -f dist/index.js && yarn build && git ac wip && git push"
1313
},
1414
"devDependencies": {
15-
"@vercel/ncc": "^0.28.6",
15+
"@vercel/ncc": "^0.31.1",
1616
"eslint": "^7.27.0",
1717
"eslint-config-prettier": "^8.3.0",
18-
"eslint-plugin-prettier": "^3.4.0",
18+
"eslint-plugin-prettier": "^4.0.0",
1919
"jest": "^27.0.3",
2020
"prettier": "^2.3.0"
2121
},

0 commit comments

Comments
 (0)