-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
54 lines (43 loc) · 1.37 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const process = require("process");
const os = require("os");
const core = require("@actions/core");
const exec = require("@actions/exec");
async function main() {
try {
if (os.platform() === "darwin") {
// Fix for GitHub actions macos-11 screencapture not working
// REF: https://github.com/actions/runner-images/issues/5960
const width = core.getInput("resolutionWidth") || "1920";
const height = core.getInput("resolutionHeight") || "1080";
try {
await exec.exec(
`"/Library/Application Support/VMware Tools/vmware-resolutionSet" ${width} ${height}`
);
} catch {
// swallow
}
const record = core.getInput("record") || false;
if (record === "true") {
process.argv.push("--record");
}
const ignoreTccDb = core.getInput("ignoreTccDb") || false;
if (ignoreTccDb === "true") {
process.argv.push("--ignore-tcc-db");
}
}
if (os.platform() === "win32") {
const nvdaInstallDirectory = core.getInput("nvdaInstallDir") ?? null;
if (nvdaInstallDirectory) {
process.argv.push("--nvda-install-dir");
process.argv.push(nvdaInstallDirectory);
}
}
// Run generic screen reader setup
process.argv.push("--ci");
require("@guidepup/setup");
} catch (err) {
core.setFailed(err);
process.exit();
}
}
main();