From 4e4ff2b32081b444abbfdd08078ad7d501fff6b6 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 19 Jul 2020 10:04:58 +0200 Subject: [PATCH] convert error into string an mark build as failed --- dist/index.js | 2 +- package.json | 2 +- src/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index df51b0e..3592ed6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2654,7 +2654,7 @@ const instance = axios.create(instanceConfig); core.setOutput('response', JSON.stringify(response.data)) } catch (error) { if (error.toJSON) { - core.setOutput(error.toJSON()); + core.setOutput(JSON.stringify(error.toJSON())); } if (error.response) { diff --git a/package.json b/package.json index 2b469e7..eae551c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "http-request-action", - "version": "1.3.0", + "version": "1.3.2", "description": "", "main": "src/index.js", "private": false, diff --git a/src/index.js b/src/index.js index 38c535d..ad18ae1 100644 --- a/src/index.js +++ b/src/index.js @@ -58,7 +58,7 @@ const instance = axios.create(instanceConfig); core.setOutput('response', JSON.stringify(response.data)) } catch (error) { if (error.toJSON) { - core.setOutput(error.toJSON()); + core.setFailed(JSON.stringify(error.toJSON())); } if (error.response) {