Skip to content

Commit 32fe560

Browse files
AddonoCopilot
andcommitted
fix: remove playwright auto-install to prevent CI timeout
The execFileSync call to 'npx playwright install chromium' would hang in CI environments without cached browsers, causing integration tests to time out. Removing the auto-install step lets chromium.launch() fail immediately with a clear error, which the tests already handle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 38e87e9 commit 32fe560

2 files changed

Lines changed: 18 additions & 26 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ npm install -g @addono/gh-attach --registry=https://npm.pkg.github.com
2929
gh extension install Addono/gh-attach
3030
```
3131

32+
## Run without installing (npx)
33+
34+
Add the GitHub Packages registry to your project's `.npmrc`:
35+
36+
```
37+
@addono:registry=https://npm.pkg.github.com
38+
```
39+
40+
Then run any command directly:
41+
42+
```bash
43+
# Upload an image
44+
npx @addono/gh-attach upload ./screenshot.png --target owner/repo#42
45+
46+
# Start the MCP server
47+
npx @addono/gh-attach mcp --transport stdio
48+
```
49+
3250
## Quick Start
3351

3452
```bash

src/cli/commands/login.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { chromium } from "playwright";
2-
import { execFileSync } from "child_process";
32
import {
43
isSessionExpired,
54
loadSession,
@@ -57,22 +56,6 @@ export async function loginCommand(options: LoginOptions) {
5756
info("Opening browser for GitHub authentication...");
5857
info("Please log in to GitHub in the browser window that opens.");
5958

60-
// Ensure Playwright browsers are installed before attempting to launch
61-
const browserPath = chromium.executablePath();
62-
if (!browserPath || !(await fileExists(browserPath))) {
63-
info("Playwright browsers not found. Installing Chromium...");
64-
try {
65-
execFileSync("npx", ["playwright", "install", "chromium"], {
66-
stdio: "inherit",
67-
});
68-
} catch {
69-
throw new AuthenticationError(
70-
"Failed to install Playwright browsers. Run 'npx playwright install chromium' manually.",
71-
"PLAYWRIGHT_INSTALL_FAILED",
72-
);
73-
}
74-
}
75-
7659
const browser = await chromium.launch({ headless: false });
7760
const context = await browser.newContext();
7861
const page = await context.newPage();
@@ -137,12 +120,3 @@ export async function loginCommand(options: LoginOptions) {
137120
}
138121
}
139122

140-
async function fileExists(path: string): Promise<boolean> {
141-
try {
142-
const { access } = await import("fs/promises");
143-
await access(path);
144-
return true;
145-
} catch {
146-
return false;
147-
}
148-
}

0 commit comments

Comments
 (0)