Skip to content

Commit b7dddee

Browse files
ci: trust the CI workspace for the app's git subprocess + log raw gitInfo
The qa audit's cockpit.gitInfo check stayed red after putting the checkout on a branch, so the app's `git -C <repo> status` subprocess is returning null in the CI electron context rather than merely reporting a detached HEAD. Add safe.directory for the workspace (covers git's "dubious ownership" refusal, which a subprocess can hit even when the shell step does not) and log the raw gitInfo object on failure so the exact cause is visible if this still doesn't resolve. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mg6v4fHnr1g2UsVUVv2VDi
1 parent 51f4391 commit b7dddee

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ jobs:
5353
# in detached HEAD (no current branch), so that check would fail for an environment reason unrelated
5454
# to the app — put the checkout on a real branch first. (Local `npm run qa:audit` is already on one.)
5555
- name: Put the checkout on a branch for the gitInfo check
56-
run: git checkout -B ci-audit
56+
run: |
57+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
58+
git checkout -B ci-audit
5759
- name: Run the audit under a virtual display
5860
run: xvfb-run -a node qa/audit.mjs
5961
env:

‎qa/audit.mjs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ ipc.langRoundTrip = await win.evaluate(async () => {
4242
// The handler is allowlist-guarded, so register this checkout as an allowed folder first
4343
// (on CI the checkout lives outside the default ~/Documents/GitHub scan root).
4444
await win.evaluate(async (p) => window.devdeck.addFolder(p), root);
45-
ipc.cockpitGitInfo = await win.evaluate(async (p) => {
46-
const info = await window.devdeck.cockpit.gitInfo(p);
47-
return typeof info?.branch === 'string' && info.branch.length > 0;
48-
}, root);
45+
const gitInfoRaw = await win.evaluate(async (p) => (await window.devdeck.cockpit.gitInfo(p)) ?? null, root);
46+
ipc.cockpitGitInfo = typeof gitInfoRaw?.branch === 'string' && gitInfoRaw.branch.length > 0;
4947
ipc.usageShape = await win.evaluate(async () => {
5048
const r = await window.devdeck.usageReport(0);
5149
return { hasGlobal: !!r.global, hasByProject: Array.isArray(r.byProject), hasByModel: Array.isArray(r.byModel) };
@@ -110,7 +108,7 @@ if (criticalViolations.length > 0 || surfaceFails.length > 0 || titlebarFails.le
110108
if (criticalViolations.length > 0) console.error(' a11y critical/serious:', JSON.stringify(criticalViolations, null, 2));
111109
if (surfaceFails.length > 0) console.error(' ipc.surface checks failed:', surfaceFails.map(([k]) => k).join(', '));
112110
if (titlebarFails.length > 0) console.error(' ipc.titlebar checks failed:', titlebarFails.map(([k]) => k).join(', '));
113-
if (gitInfoFail) console.error(' cockpit.gitInfo did not resolve a branch for the repo root:', ipc.cockpitGitInfo);
111+
if (gitInfoFail) console.error(' cockpit.gitInfo did not resolve a branch for the repo root:', ipc.cockpitGitInfo, '· raw gitInfo:', JSON.stringify(gitInfoRaw));
114112
process.exit(1);
115113
}
116114
console.log('done');

0 commit comments

Comments
 (0)