File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ function run() {
117
117
}
118
118
catch (error) {
119
119
core.debug((0, util_1.inspect)(error));
120
- core.setFailed(error.message );
120
+ core.setFailed(utils.getErrorMessage(error) );
121
121
}
122
122
});
123
123
}
@@ -151,7 +151,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
151
151
return result;
152
152
};
153
153
Object.defineProperty(exports, "__esModule", ({ value: true }));
154
- exports.getStringAsArray = exports.getInputAsArray = void 0;
154
+ exports.getErrorMessage = exports. getStringAsArray = exports.getInputAsArray = void 0;
155
155
const core = __importStar(__nccwpck_require__(2186));
156
156
function getInputAsArray(name, options) {
157
157
return getStringAsArray(core.getInput(name, options));
@@ -164,6 +164,12 @@ function getStringAsArray(str) {
164
164
.filter(x => x !== '');
165
165
}
166
166
exports.getStringAsArray = getStringAsArray;
167
+ function getErrorMessage(error) {
168
+ if (error instanceof Error)
169
+ return error.message;
170
+ return String(error);
171
+ }
172
+ exports.getErrorMessage = getErrorMessage;
167
173
168
174
169
175
/***/ }),
Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ async function run(): Promise<void> {
81
81
} else {
82
82
core . info ( `File not found at path '${ inputs . contentFilepath } '` )
83
83
}
84
- } catch ( error : any ) {
84
+ } catch ( error ) {
85
85
core . debug ( inspect ( error ) )
86
- core . setFailed ( error . message )
86
+ core . setFailed ( utils . getErrorMessage ( error ) )
87
87
}
88
88
}
89
89
Original file line number Diff line number Diff line change @@ -13,3 +13,8 @@ export function getStringAsArray(str: string): string[] {
13
13
. map ( s => s . trim ( ) )
14
14
. filter ( x => x !== '' )
15
15
}
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