-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HD-11: Allow Logging Command Results (#26)
- Loading branch information
Jean Carlos Taveras
authored
Mar 24, 2022
1 parent
e99ede0
commit 0d5d4bc
Showing
3 changed files
with
54 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import * as core from "@actions/core"; | ||
import { getInput, info, setFailed } from "@actions/core"; | ||
import { exec } from "child_process"; | ||
import { promisify } from "util"; | ||
|
||
import { authenticationScript } from "./scripts"; | ||
|
||
export default async function herokuLogin() { | ||
try { | ||
await promisify(exec)(authenticationScript(core.getInput('email'), core.getInput('api_key'))); | ||
core.info('Logged in successfully.'); | ||
const { stdout } = await promisify(exec)(authenticationScript(getInput('email'), getInput('api_key'))); | ||
|
||
info('Logged in successfully. 🔐'); | ||
info(`stdout: ${stdout}`) | ||
} catch (error) { | ||
core.setFailed(`Authentication process failed. Error: ${(error as Error).message}`); | ||
setFailed(`Authentication process failed. Error: ${(error as Error).message}`); | ||
} | ||
} |