File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ function run() {
117117 }
118118 catch (error) {
119119 core.debug((0, util_1.inspect)(error));
120- core.setFailed(error.message );
120+ core.setFailed(utils.getErrorMessage(error) );
121121 }
122122 });
123123}
@@ -151,7 +151,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
151151 return result;
152152};
153153Object.defineProperty(exports, "__esModule", ({ value: true }));
154- exports.getStringAsArray = exports.getInputAsArray = void 0;
154+ exports.getErrorMessage = exports. getStringAsArray = exports.getInputAsArray = void 0;
155155const core = __importStar(__nccwpck_require__(2186));
156156function getInputAsArray(name, options) {
157157 return getStringAsArray(core.getInput(name, options));
@@ -164,6 +164,12 @@ function getStringAsArray(str) {
164164 .filter(x => x !== '');
165165}
166166exports.getStringAsArray = getStringAsArray;
167+ function getErrorMessage(error) {
168+ if (error instanceof Error)
169+ return error.message;
170+ return String(error);
171+ }
172+ exports.getErrorMessage = getErrorMessage;
167173
168174
169175/***/ }),
Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ async function run(): Promise<void> {
8181 } else {
8282 core . info ( `File not found at path '${ inputs . contentFilepath } '` )
8383 }
84- } catch ( error : any ) {
84+ } catch ( error ) {
8585 core . debug ( inspect ( error ) )
86- core . setFailed ( error . message )
86+ core . setFailed ( utils . getErrorMessage ( error ) )
8787 }
8888}
8989
Original file line number Diff line number Diff line change @@ -13,3 +13,8 @@ export function getStringAsArray(str: string): string[] {
1313 . map ( s => s . trim ( ) )
1414 . filter ( x => x !== '' )
1515}
16+
17+ export function getErrorMessage ( error : unknown ) {
18+ if ( error instanceof Error ) return error . message
19+ return String ( error )
20+ }
You can’t perform that action at this time.
0 commit comments