Skip to content

Commit

Permalink
playwright runs in shell
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Dec 13, 2024
1 parent 5784c34 commit a02dc41
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 25 deletions.
32 changes: 20 additions & 12 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

31 changes: 19 additions & 12 deletions src/scripts/testing.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import { setFailed } from "@actions/core";
import { stepResponse, buildComment } from "src/main";
import { exec } from "@actions/exec";
// import { exec } from "@actions/exec";
import { execSync } from "child_process";

export const testing = async (): Promise<stepResponse> => {
const runCommand = async (command: string): Promise<string> => {
return new Promise((resolve, reject) => {
exec(command, [], {
listeners: {
stdout: (data: Buffer) => {
resolve(data.toString());
},
stderr: (data: Buffer) => {
reject(new Error(data.toString()));
},
},
}).catch((error: Error) => {
try {
const output = execSync(command, { encoding: "utf-8" });
resolve(output);
} catch (error) {
reject(error);

Check failure on line 13 in src/scripts/testing.ts

View workflow job for this annotation

GitHub Actions / code-quality

Expected the Promise rejection reason to be an Error
});
}
// exec(command, [], {
// listeners: {
// stdout: (data: Buffer) => {
// resolve(data.toString());
// },
// stderr: (data: Buffer) => {
// reject(new Error(data.toString()));
// },
// },
// }).catch((error: Error) => {
// reject(error);
// });
});
};

Expand Down

0 comments on commit a02dc41

Please sign in to comment.