From 01348d56054ff27cb07e8f74f6e29f5e3fabffc5 Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Fri, 7 Apr 2023 13:22:46 +0200 Subject: [PATCH] Use NPM to publish --- .changeset/six-olives-flash.md | 5 +++++ .github/workflows/publish.yml | 2 +- src/lib/RoadieAgentForwarder.ts | 14 ++++++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .changeset/six-olives-flash.md diff --git a/.changeset/six-olives-flash.md b/.changeset/six-olives-flash.md new file mode 100644 index 0000000..493e800 --- /dev/null +++ b/.changeset/six-olives-flash.md @@ -0,0 +1,5 @@ +--- +'@roadiehq/roadie-agent': patch +--- + +Move publish to CI diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bbf7915..c0e432b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -98,7 +98,7 @@ jobs: run: | git config --global user.email "bot@roadie.io" git config --global user.name "roadie-bot" - yarn publish + npm publish # Creates the next available tag with format "release---[.]" - name: Create a release tag id: create_tag diff --git a/src/lib/RoadieAgentForwarder.ts b/src/lib/RoadieAgentForwarder.ts index fc6a31c..0ace356 100644 --- a/src/lib/RoadieAgentForwarder.ts +++ b/src/lib/RoadieAgentForwarder.ts @@ -28,10 +28,16 @@ export class RoadieAgentForwarder { 'Content-Type': 'application/json', }, }); - const responseBody = await response.text(); - this.logger.info( - `Received response from forwarder mutation. Status: ${response.status}, ${response.statusText}. Body: ${responseBody}`, - ); + try { + const responseBody = await response.text(); + this.logger.info( + `Received response from forwarder mutation. Status: ${response.status}, ${response.statusText}. Body: ${responseBody}`, + ); + } catch (e) { + this.logger.warn( + `No Response received from forwarder mutation. Status: ${response?.status}, ${response?.statusText}.`, + ); + } }; } }