From a181f8e6e8841e7ec0f9388093730678bb88ae8d Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 20 May 2024 11:55:57 -0300 Subject: [PATCH] Pass HTTP body to failure log --- src/index.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index bda18a7..11740e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -277,13 +277,9 @@ class MagicNixCacheAction { `http://${this.hostAndPort}/api/workflow-start`, ); - actionsCore.debug( - `post to /api/workflow-start (status: ${res.statusCode}, body: ${res.body})`, - ); - if (res.statusCode !== 200) { this.failInStrictMode( - `Failed to trigger workflow start hook; expected status 200 but got ${res.statusCode}`, + `Failed to trigger workflow start hook; expected status 200 but got (status: ${res.statusCode}, body: ${res.body})`, ); } @@ -320,13 +316,9 @@ class MagicNixCacheAction { `http://${this.hostAndPort}/api/workflow-finish`, ); - actionsCore.debug( - `post to /api/workflow-finish (status: ${res.statusCode}, body: ${res.body})`, - ); - if (res.statusCode !== 200) { this.failInStrictMode( - `Failed to trigger workflow finish hook; expected status 200 but got ${res.statusCode}`, + `Failed to trigger workflow finish hook; expected status 200 but got (status: ${res.statusCode}, body: ${res.body})`, ); } } finally {