From 08236cabe405757bd5d8b6ae86de3be2aa9e2cb7 Mon Sep 17 00:00:00 2001 From: Etienne Lescot Date: Wed, 5 Aug 2026 00:24:57 +0200 Subject: [PATCH] ci(macos): reject a MAC_CSC_NAME that carries its certificate type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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. --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67842431f..a56138701 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,6 +140,29 @@ jobs: APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} run: | if [[ -n "$MAC_CERTIFICATE_P12" && -n "$MAC_CERTIFICATE_PASSWORD" && -n "$MAC_CSC_NAME" && -n "$APPLE_ID" && -n "$APPLE_TEAM_ID" && -n "$APPLE_APP_SPECIFIC_PASSWORD" ]]; then + # `CSC_NAME` must name the identity WITHOUT its certificate type. + # electron-builder picks the type itself and rejects a qualified name + # outright: + # + # ⨯ Please remove prefix "Developer ID Application:" from the + # specified name — appropriate certificate will be chosen + # automatically + # + # It does that at `Package .app bundle`, which sits after the ffmpeg + # build and the compositor addon — about twelve minutes in, and only + # on macOS. Since the same secret also feeds `codesign --sign` at + # `Sign DMG`, the mistake is easy to make: codesign accepts the full + # common name, so the qualified form looks right until electron-builder + # sees it. The short form satisfies both, because codesign matches on a + # substring of the common name. + case "$MAC_CSC_NAME" in + # Every pattern ends at the colon on purpose, so a company whose + # name merely starts with one of these words is not rejected. + "Developer ID Application:"*|"Developer ID Installer:"*|"Apple Development:"*|"Apple Distribution:"*|"3rd Party Mac Developer Application:"*|"3rd Party Mac Developer Installer:"*) + echo "::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" + exit 1 + ;; + esac echo "enabled=true" >> "$GITHUB_OUTPUT" else echo "enabled=false" >> "$GITHUB_OUTPUT"