fix: disable macOS code signing to prevent 'app damaged' error#152
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRemoves macOS hardened runtime and entitlements directives from electron-builder and deletes ChangesmacOS Code Signing Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/build-desktop.yml (1)
498-511:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAlign PR signing controls with the “unsigned macOS” goal
mac.identity: nullalready disables macOS code signing (and hardened runtime) in electron-builder, so the missingsign: falseis unlikely to re-enable signing by itself. The real mismatch isCSC_FOR_PULL_REQUEST: true, which allows signing logic to run for PR builds—set it tofalseto match the intent of never attempting signing on PR artifacts.🔧 Suggested fix
} else if ('${{ matrix.os }}' === 'macos-latest') { packageJson.build.mac = { target: [ { target: 'dmg', arch: ['x64', 'arm64'] } ], icon: 'build/icon.png', category: 'public.app-category.productivity', gatekeeperAssess: false, identity: null, + sign: false };- CSC_FOR_PULL_REQUEST: true + CSC_FOR_PULL_REQUEST: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build-desktop.yml around lines 498 - 511, The PR allows signing to run despite intending unsigned macOS artifacts—set the CI env var CSC_FOR_PULL_REQUEST to false in the build workflow and also make the mac build intent explicit by adding sign: false alongside the existing packageJson.build.mac.identity = null; update the workflow matrix branch where CSC_FOR_PULL_REQUEST is defined and update the mac object (target identity) in the packageJson generation (reference symbols: CSC_FOR_PULL_REQUEST, packageJson.build.mac, identity, sign) so PR builds never attempt code signing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/build-desktop.yml:
- Around line 498-511: The PR allows signing to run despite intending unsigned
macOS artifacts—set the CI env var CSC_FOR_PULL_REQUEST to false in the build
workflow and also make the mac build intent explicit by adding sign: false
alongside the existing packageJson.build.mac.identity = null; update the
workflow matrix branch where CSC_FOR_PULL_REQUEST is defined and update the mac
object (target identity) in the packageJson generation (reference symbols:
CSC_FOR_PULL_REQUEST, packageJson.build.mac, identity, sign) so PR builds never
attempt code signing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: eb74bb2e-a41c-486b-950e-31ee3433a8af
📒 Files selected for processing (1)
.github/workflows/build-desktop.yml
electron-builder with identity:null + hardenedRuntime:true produced an ad-hoc signed binary with broken signing structure (no Sealed Resources), causing Gatekeeper to reject it as 'damaged'. - Remove hardenedRuntime and entitlements from electron-builder.yml - Remove identity:null and hardenedRuntime from workflow mac config - PR builds still skip signing by design (electron-builder behavior) - Release builds (tag pushes) will perform ad-hoc signing correctly Closes #151
042fe1d to
c66bb14
Compare
Summary
Fixes macOS "app is damaged, cannot open" error reported in #151.
Root Cause
The build config sets
identity: null(skip signing) but keepshardenedRuntime: true, causing electron-builder to produce an ad-hoc signed binary with no Sealed Resources. Gatekeeper on macOS rejects this as "damaged":Changes
hardenedRuntime,entitlements,entitlementsInherit; addsign: falsehardenedRuntime: true; addsign: falsealongside existingidentity: nullUser Impact
After this fix, macOS users can open the app by right-clicking → Open on first launch. No code signing certificate required.
Closes #151
Summary by CodeRabbit