Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use getExecOutput() of @actions/exec #50

Merged
merged 1 commit into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 2 additions & 9 deletions dist/index.cjs

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

13 changes: 3 additions & 10 deletions lib/index.js
@@ -1,5 +1,5 @@
import * as core from "@actions/core";
import { exec } from "@actions/exec";
import { exec, getExecOutput } from "@actions/exec";
import { getOctokit } from "@actions/github";
import { RequestError } from "@octokit/request-error";

Expand Down Expand Up @@ -36,15 +36,8 @@ export const npmDiffCommand = ({ name, from, to }) => [
* @param {string[]} cmdArgs
*/
const runCommand = async (cmd, cmdArgs) => {
let out = "";
await exec(cmd, cmdArgs, {
listeners: {
stdout: (data) => {
out += data.toString();
},
},
});
return out;
const { stdout } = await getExecOutput(cmd, cmdArgs);
return stdout;
};

/**
Expand Down