Repository navigation
ci(release): 发布前打印 OIDC 声明,便于排查可信发布 403 - #19
Merged
Merged
Conversation
可信发布失败时的报错只有一句「OIDC permission denied for this action」, 看不出是哪个声明不匹配。加一步在 npm publish 之前把 npm 实际会看到的声明 打印出来(只打印声明,不含令牌本体):job_workflow_ref 必须是 npm 上 Trusted Publisher 填的 workflow 文件名,environment 必须与填写值一致。 continue-on-error,不会因为排查步骤本身影响发布。
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.
目的
npm 可信发布失败时,报错只有一句:
看不出是哪个声明不匹配。加一步在
npm publish之前把 npm 实际会看到的 OIDC 声明打印出来(只打印声明字段,不含令牌本体):对照关系:
job_workflow_ref里的文件名必须是 npm Trusted Publisher 填的 Workflow filenameenvironment必须与填写的 Environment 一致(没填就不该出现该声明)continue-on-error: true,排查步骤本身不会影响发布是否成功。背景
v0.2.0的 Release 已经失败两次,都卡在最后一步「发布到 npm」,前面的门禁(构建 + 源码/产物检查 + 真实 VSIX 端到端)全部通过,tarball 也正常产出
(41.4 kB / 7 files),provenance 甚至已经签好并写入 sigstore 透明日志,只在
registry 的 PUT 上被 403 拒掉。