From 2b10f41b5a33808f6d24eafd253296766308b7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gary=20Gro=C3=9Fgarten?= Date: Fri, 8 Jan 2021 13:49:04 +0100 Subject: [PATCH] 0.6.4 --- dist/index.js | 7 +++++++ lib/index.js | 7 +++++++ package-lock.json | 2 +- package.json | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7045fd0b..6a2a8c25 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11352,6 +11352,9 @@ function executeCommand(ssh, command) { throw Error(`Command exited with code ${code}`); } console.log('✅ SSH Action finished.'); + if (ssh.isConnected()) { + ssh.dispose(); + } } catch (err) { console.error(`⚠️ An error happened executing command ${command}.`, (_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err); @@ -11360,6 +11363,10 @@ function executeCommand(ssh, command) { } }); } +process.on('uncaughtException', (err) => { + if (err['code'] !== 'ECONNRESET') + throw err; +}); run(); diff --git a/lib/index.js b/lib/index.js index bd03f7e0..b837a382 100644 --- a/lib/index.js +++ b/lib/index.js @@ -97,6 +97,9 @@ function executeCommand(ssh, command) { throw Error(`Command exited with code ${code}`); } console.log('✅ SSH Action finished.'); + if (ssh.isConnected()) { + ssh.dispose(); + } } catch (err) { console.error(`⚠️ An error happened executing command ${command}.`, (_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err); @@ -105,4 +108,8 @@ function executeCommand(ssh, command) { } }); } +process.on('uncaughtException', (err) => { + if (err['code'] !== 'ECONNRESET') + throw err; +}); run(); diff --git a/package-lock.json b/package-lock.json index ff792fcf..5d4ab25f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@garygrossgarten/github-action-ssh", - "version": "0.6.3", + "version": "0.6.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 346e034f..754d40e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@garygrossgarten/github-action-ssh", - "version": "0.6.3", + "version": "0.6.4", "description": "Run commands on a remote server via SSH.", "repository": { "type": "git",