Skip to content

Commit 81f84b5

Browse files
CopilotCopilot
andcommitted
fix: address Copilot review comments on PR #1023
- skill.ts: add await to async ghAvailable() call - skill.ts: add shell: IS_WINDOWS to all execFileAsync('gh') calls - squad-pr-nudge.yml: fix reversed compareCommits base/head args - squad-insider-publish.yml: fix nested double-quotes in bash - watch/health.ts: add timeout to execFileSync call - apm-integration.md: fix package name to @bradygaster/squad-cli Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e919f7e commit 81f84b5

5 files changed

Lines changed: 11 additions & 9 deletions

File tree

.changeset/apm-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"squad": minor
2+
"@bradygaster/squad-cli": minor
33
---
44

55
feat: APM integration — squad skill publish/install + apm.yml in init

.github/workflows/squad-insider-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
pkg.dependencies['@bradygaster/squad-sdk'] = '$SDK_VERSION';
120120
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
121121
"
122-
echo "Verified: $(node -p "require('./package.json').dependencies['@bradygaster/squad-sdk']")"
122+
echo "Verified: $(node -p 'require("./package.json").dependencies["@bradygaster/squad-sdk"]')"
123123
124124
- name: Publish squad-sdk with insider tag
125125
run: npm -w packages/squad-sdk publish --tag insider --access public

.github/workflows/squad-pr-nudge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ jobs:
143143
const comparison = await github.rest.repos.compareCommits({
144144
owner: context.repo.owner,
145145
repo: context.repo.repo,
146-
base: pr.head.sha,
147-
head: pr.base.ref
146+
base: pr.base.ref,
147+
head: pr.head.sha
148148
});
149149
if (comparison.data.ahead_by > 10) {
150150
actions.push(`⬇️ **${comparison.data.ahead_by} commits behind ${pr.base.ref}.** Rebase to pick up latest changes.`);

packages/squad-cli/src/cli/commands/skill.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { fatal } from '../core/errors.js';
1717
import { detectSquadDir } from '../core/detect-squad-dir.js';
1818
import { ghAvailable } from '../core/gh-cli.js';
1919

20+
const IS_WINDOWS = process.platform === 'win32';
2021
const execFileAsync = promisify(execFile);
2122

2223
// ── Types ─────────────────────────────────────────────────────────────────────
@@ -262,7 +263,7 @@ async function install(dest: string, source: string): Promise<void> {
262263
const repo = parts[1]!;
263264
const skillFilter = parts.length >= 3 ? parts.slice(2).join('/') : undefined;
264265

265-
if (!ghAvailable()) {
266+
if (!(await ghAvailable())) {
266267
fatal('GitHub CLI (gh) is required for APM install. Install from https://cli.github.com/');
267268
}
268269

@@ -316,7 +317,7 @@ async function installFromGitHub(
316317
'api',
317318
`repos/${owner}/${repo}/contents/apm.yml`,
318319
'--jq', '.content',
319-
]);
320+
], { shell: IS_WINDOWS });
320321
apmContent = Buffer.from(stdout.trim(), 'base64').toString('utf8');
321322
} catch {
322323
// No apm.yml — fall back to scanning skills directories
@@ -378,7 +379,7 @@ async function installFromGitHub(
378379
'api',
379380
`repos/${owner}/${repo}/contents/${skill.path}`,
380381
'--jq', '.content',
381-
]);
382+
], { shell: IS_WINDOWS });
382383
const content = Buffer.from(rawContent.trim(), 'base64').toString('utf8');
383384
const skillDir = join(skillsDir, skill.name);
384385
await mkdir(skillDir, { recursive: true });
@@ -421,7 +422,7 @@ async function installSkillsFromSquadDir(
421422
'api',
422423
`repos/${owner}/${repo}/contents/${candidate}`,
423424
'--jq', '[.[] | {name: .name, path: .path, type: .type}]',
424-
]);
425+
], { shell: IS_WINDOWS });
425426
entries = JSON.parse(stdout);
426427
break;
427428
} catch {
@@ -453,7 +454,7 @@ async function installSkillsFromSquadDir(
453454
'api',
454455
`repos/${owner}/${repo}/contents/${skillFilePath}`,
455456
'--jq', '.content',
456-
]);
457+
], { shell: IS_WINDOWS });
457458
const content = Buffer.from(rawContent.trim(), 'base64').toString('utf8');
458459
const skillDir = join(skillsDir, dir.name);
459460
await mkdir(skillDir, { recursive: true });

packages/squad-cli/src/cli/commands/watch/health.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function probeCurrentGhUser(): string | undefined {
8585
encoding: 'utf-8',
8686
stdio: ['pipe', 'pipe', 'pipe'],
8787
shell: IS_WINDOWS,
88+
timeout: 10_000,
8889
});
8990
const match = result.match(/account\s+(\S+)/);
9091
return match?.[1];

0 commit comments

Comments
 (0)