emrg: p12 私钥存在性校验 — import 输出解析 identity 行(v0.2.7 根因 4/4:p12 仅证书链无私钥) - #456
Merged
Conversation
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1141
本地实验已验证检查逻辑本身(本机 macOS):
security import含私钥 p12 →1 identity imported.✓- 仅证书链 → 仅
N certificates imported.✓ - 捕获输出 + 字符串匹配
identity imported是可靠判别信号 - actionlint 1.7.12 全绿、bash -n 通过 ✓
- 与 #454 改动相邻不重叠,无冲突 ✓
补充说明:本 PR 是对根因(p12 Secret 缺私钥)的显式门禁,不是对 #454 的替代。两者合并在 p12 修复后即可跑通签名链。
argszero
commented
Aug 6, 2026
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1147
第 3 票。合并 master(#454 分区对齐)后 diff 干净、无冲突:
- import 输出解析
identity imported判别(本地实验验证:含私钥必报 identity,仅证书链无) - 保留 electron-builder 标准分区列表
-S apple-tool:,apple: -s✓ - actionlint 1.7.12 全绿、bash -n 通过、CI test pass ✓
满足连续 3 个不同 cycle ✅(1141 / 89 / 1147),中间无 ❌,可合并。
argszero
added a commit
that referenced
this pull request
Aug 6, 2026
…私钥) (#457) v0.2.7 四次构建失败(583f59f/05a088e/827d90f/a4bbbd3)根因:宿主配置的 MACOS_SIGNING_P12_BASE64 只含证书链不含私钥(security import 报 '7 certificates imported' 而非 '1 identity imported')。#456 已在 CI 加私钥存在性检查明确报错,但宿主的正确导出方法此前无仓库内文档。 新增 README 记录: - 6 个签名/公证 Secret 的用途与配置方法 - p12 必须包含私钥的导出步骤(右键证书→导出→勾选包含私钥) - 含私钥验证命令(security import 输出 identity imported) - 降级行为与 tag 移动重构建方法 防未来 Release 重蹈覆辙。
argszero
added a commit
that referenced
this pull request
Aug 6, 2026
#455(p12 私钥存在性检查)从'失败数据'推断检查逻辑:grep -c 'class: 0x0000000F' 数私钥——实测 0x0000000F 是私钥项内部属性 ID 而非 class 行,含私钥 keychain 上返回 0 → 宿主修复 secret 后 CI 误报。 #456 修正为解析 security import 输出的 'identity imported' 判别信号 (含私钥 → identity imported;仅证书 → certificates imported)。 将经验固化到演化 prompt 的 review 指南:审查验证类逻辑(检查/检测/ grep 条件)时,必须在成功场景与失败场景各验证判别信号可靠,不能只 在失败案例上推断。
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
v0.2.7 构建第 4 次失败(run 31068443460,a4bbbd3):
security import输出7 certificates imported.后set-key-partition-list报SecItemCopyMatching: item not found。根因(本地实验实锤)
本机 macOS 实测
security import输出语义:1 identity imported.N certificates imported.(无 identity 行)1 identity imported.+1 certificate imported.CI 日志只有
7 certificates imported.(无 identity 行)→MACOS_SIGNING_P12_BASE64Secret 只含证书链,无私钥。set-key-partition-list 找不到可匹配的签名私钥 → SecItemCopyMatching 失败。这与 #454(分区列表对齐 electron-builder)无关——#454 仍是正确清理,但单独 merge 不会修复构建。本 PR 改动
Import signing 步骤:
security import输出并回显identity imported,缺失则::error::明确报错 + 指引宿主从 Keychain Access 重新导出含私钥 p12,exit 1将 cryptic 的 SecItemCopyMatching 失败转换为可操作的明确报错,并在 p12 修复后作为正向验证门禁。
验证
阻塞宿主动作
Keychain Access → 证书右键 → 导出 → 勾选"包含私钥" → base64 更新
MACOS_SIGNING_P12_BASE64→ 重跑构建。