Skip to content

ci(macos): reject a MAC_CSC_NAME that carries its certificate type - #264

Merged
EtienneLescot merged 1 commit into
release/v1.9.0from
fix/validate-csc-name
Aug 4, 2026
Merged

ci(macos): reject a MAC_CSC_NAME that carries its certificate type#264
EtienneLescot merged 1 commit into
release/v1.9.0from
fix/validate-csc-name

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Validate MAC_CSC_NAME in Resolve macOS signing and fail immediately if it carries a certificate-type prefix, instead of letting electron-builder discover it twelve minutes later.

Why

CSC_NAME must name the identity without its type — electron-builder selects the certificate type itself and rejects a qualified name:

⨯ Please remove prefix "Developer ID Application:" from the specified name
  — appropriate certificate will be chosen automatically

It rejects at Package .app bundle, which sits after Vendor LGPL ffmpeg and Build Metal compositor addon. In run 30950523913 — the first build ever to have signing enabled — that cost a full macOS job to learn that a secret had four extra words in it.

The mistake is easy to make because the same secret feeds two different consumers: CSC_NAME for electron-builder, and codesign --sign at Sign DMG. codesign happily accepts the full common name, so the qualified form looks correct everywhere until electron-builder sees it. The short form satisfies both, since codesign matches on a substring of the common name — verified locally:

$ codesign --sign "Etienne Lescot (M4LK7C6S84)" ...
Authority=Developer ID Application: Etienne Lescot (M4LK7C6S84)
TeamIdentifier=M4LK7C6S84

Behaviour

The check runs only when signing is enabled — every other signing input is already validated in that same step — and the error names the value to use:

::error::MAC_CSC_NAME carries a certificate-type prefix. Set it to the identity
name alone, e.g. 'Jane Doe (AB12CD34EF)' rather than 'Developer ID Application:
Jane Doe (AB12CD34EF)'. Read it from: security find-identity -v -p codesigning

Covers the Developer ID, Apple Development/Distribution and 3rd Party Mac Developer prefixes. Every pattern ends at the colon, so an organisation whose name merely begins with one of those words is not rejected.

Related issue

Refs #

Type of change

  • Enhancement

Release impact

  • No release note needed

Desktop impact

  • macOS
  • Installer / packaging

Testing

Shell logic exercised against the real values and the false-positive edge case:

REJETE   <Developer ID Application: Etienne Lescot (M4LK7C6S84)>   ← the value that broke the build
REJETE   <3rd Party Mac Developer Application: Acme (X1)>
accepte  <3rd Party Mac Developer Tools Inc (X1)>                  ← no colon, not a prefix
accepte  <Etienne Lescot (M4LK7C6S84)>                             ← the value in use now

Workflow YAML parses (js-yaml); npm run docs:check OK (22 files). No documentation asserts anything about MAC_CSC_NAME's format, so nothing needed updating — release-and-secrets.md describes the secret's purpose, not its shape.

`CSC_NAME` must name the identity without its certificate type;
electron-builder chooses the type itself and refuses a qualified name:

  ⨯ Please remove prefix "Developer ID Application:" from the specified
    name — appropriate certificate will be chosen automatically

It refuses at `Package .app bundle`, which runs after the ffmpeg build
and the compositor addon — about twelve minutes into the macOS job, and
nowhere else. That is what happened the first time signing was enabled
here: twelve minutes to learn that a secret had four extra words.

The mistake is easy to make because the same secret also feeds
`codesign --sign` at `Sign DMG`, and codesign accepts the full common
name, so the qualified form looks correct right up until
electron-builder sees it. The short form satisfies both, since codesign
matches on a substring of the common name.

Check it in `Resolve macOS signing`, where every other signing input is
already validated, and fail in seconds with the value to use instead.
Only prefixes ending in a colon match, so a company whose name starts
with one of these words is not caught.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 153924e5-86bd-4b8f-8379-baa5576291a0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot
EtienneLescot merged commit 34b43f1 into release/v1.9.0 Aug 4, 2026
12 checks passed
@EtienneLescot
EtienneLescot deleted the fix/validate-csc-name branch August 4, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant