@@ -272,6 +272,7 @@ exports.GitHubHelper = void 0;
272
272
const core = __importStar(__nccwpck_require__(2186));
273
273
const octokit_client_1 = __nccwpck_require__(5040);
274
274
const util_1 = __nccwpck_require__(3837);
275
+ const utils = __importStar(__nccwpck_require__(918));
275
276
class GitHubHelper {
276
277
constructor(token) {
277
278
this.octokit = new octokit_client_1.Octokit({
@@ -313,7 +314,7 @@ class GitHubHelper {
313
314
yield this.octokit.rest.reactions.createForIssueComment(Object.assign(Object.assign({}, repo), { comment_id: commentId, content: reaction }));
314
315
}
315
316
catch (error) {
316
- core.debug(error);
317
+ core.debug(utils.getErrorMessage( error) );
317
318
core.warning(`Failed to set reaction on comment ID ${commentId}.`);
318
319
}
319
320
});
@@ -415,6 +416,7 @@ const github = __importStar(__nccwpck_require__(5438));
415
416
const util_1 = __nccwpck_require__(3837);
416
417
const command_helper_1 = __nccwpck_require__(9622);
417
418
const github_helper_1 = __nccwpck_require__(446);
419
+ const utils = __importStar(__nccwpck_require__(918));
418
420
function run() {
419
421
return __awaiter(this, void 0, void 0, function* () {
420
422
try {
@@ -543,7 +545,7 @@ function run() {
543
545
}
544
546
catch (error) {
545
547
core.debug((0, util_1.inspect)(error));
546
- const message = error.message ;
548
+ const message = utils.getErrorMessage(error) ;
547
549
// Handle validation errors from workflow dispatch
548
550
if (message.startsWith('Unexpected inputs provided') ||
549
551
(message.startsWith('Required input') &&
@@ -554,7 +556,7 @@ function run() {
554
556
core.warning(message);
555
557
}
556
558
else {
557
- core.setFailed(error. message);
559
+ core.setFailed(message);
558
560
}
559
561
}
560
562
});
@@ -619,7 +621,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
619
621
return result;
620
622
};
621
623
Object.defineProperty(exports, "__esModule", ({ value: true }));
622
- exports.getStringAsArray = exports.getInputAsArray = void 0;
624
+ exports.getErrorMessage = exports. getStringAsArray = exports.getInputAsArray = void 0;
623
625
const core = __importStar(__nccwpck_require__(2186));
624
626
function getInputAsArray(name, options) {
625
627
return getStringAsArray(core.getInput(name, options));
@@ -632,6 +634,12 @@ function getStringAsArray(str) {
632
634
.filter(x => x !== '');
633
635
}
634
636
exports.getStringAsArray = getStringAsArray;
637
+ function getErrorMessage(error) {
638
+ if (error instanceof Error)
639
+ return error.message;
640
+ return String(error);
641
+ }
642
+ exports.getErrorMessage = getErrorMessage;
635
643
636
644
637
645
/***/ }),
0 commit comments