Skip to content

Commit 37a08d3

Browse files
neominikclaude
andauthored
fix(desktop): local desktop builds no longer crash when a GitHub token is in the shell (pingdotgg#19277)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent bbcaa79 commit 37a08d3

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎scripts/build-desktop-artifact.test.ts‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
363363
undefined,
364364
);
365365

366-
assert.notProperty(preview, "publish");
367-
assert.notProperty(previewChannel, "publish");
366+
assert.isNull(preview.publish);
367+
assert.isNull(previewChannel.publish);
368368
assert.deepStrictEqual(release.publish, [
369369
{
370370
provider: "github",
@@ -382,6 +382,22 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
382382
),
383383
);
384384

385+
it.effect("disables electron-builder publish detection for local builds", () =>
386+
Effect.gen(function* () {
387+
const local = yield* createBuildConfig(
388+
"mac",
389+
"dmg",
390+
"0.0.33",
391+
false,
392+
false,
393+
undefined,
394+
undefined,
395+
);
396+
397+
assert.isNull(local.publish);
398+
}).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
399+
);
400+
385401
it("stages only the desktop main-process externals", () => {
386402
assert.deepStrictEqual(
387403
resolveDesktopRuntimeDependencies(

‎scripts/build-desktop-artifact.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,6 +2722,10 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
27222722
],
27232723
};
27242724
const updateChannel = resolveDesktopUpdateChannel(version);
2725+
// A missing `publish` makes electron-builder infer a GitHub feed from
2726+
// GH_TOKEN/GITHUB_TOKEN. The staged app has no repository to resolve it
2727+
// against, so writing update manifests then crashes on a null config.
2728+
buildConfig.publish = null;
27252729
if (!isDesktopPreviewVersion(version)) {
27262730
const publishConfig = yield* resolveGitHubPublishConfig(updateChannel);
27272731
if (publishConfig) {

0 commit comments

Comments
 (0)