Skip to content

Commit

Permalink
Merge pull request garygrossgarten#2 from biegl/master
Browse files Browse the repository at this point in the history
Fail action if executed commands fail
  • Loading branch information
garygrossgarten authored Feb 19, 2020
2 parents 13e1359 + 37a0886 commit ea73d55
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const billy_core_1 = require("@fivethree/billy-core");
const billy_plugin_core_1 = require("@fivethree/billy-plugin-core");
const billy_plugin_github_actions_1 = require("@garygrossgarten/billy-plugin-github-actions");
const core_1 = __importDefault(require("@actions/core"));
const node_ssh_1 = __importDefault(require("node-ssh"));
const keyboard_1 = require("./keyboard");
let SSH = class SSH {
Expand Down Expand Up @@ -80,6 +81,7 @@ let SSH = class SSH {
}
catch (err) {
console.error(`⚠️ An error happened executing command ${command}.`, err);
core_1.default.setFailed(err.message);
process.abort();
}
});
Expand Down
13 changes: 10 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"typescript": "^3.2.2"
},
"dependencies": {
"@actions/core": "^1.2.2",
"@fivethree/billy-core": "0.18.0",
"@fivethree/billy-plugin-core": "0.18.0",
"@garygrossgarten/billy-plugin-github-actions": "0.5.0",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
input,
GitHubAction
} from "@garygrossgarten/billy-plugin-github-actions";
import core from '@actions/core';

import node_ssh from "node-ssh";
import { keyboardFunction } from "./keyboard";
Expand Down Expand Up @@ -95,6 +96,7 @@ export class SSH {
console.log("✅ SSH Action finished.");
} catch (err) {
console.error(`⚠️ An error happened executing command ${command}.`, err);
core.setFailed(err.message);
process.abort();
}
}
Expand Down

0 comments on commit ea73d55

Please sign in to comment.