Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(release): attach the SBOM to the GitHub Release on dispatch publishes too (#12020)

Diego Rodrigues de Sa e Souza9dc6500ebdb6
diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml
index c34dd6e014..5ba76f069f 100644
--- a/.github/workflows/npm-publish.yml
+++ b/.github/workflows/npm-publish.yml
@@ -273,11 +273,20 @@ jobs:
if-no-files-found: error
- name: Attach SBOM to GitHub Release
- if: steps.resolve.outputs.skip != 'true' && github.event_name == 'release'
+ # Not only on the `release` event: the v3.8.50 package shipped through a
+ # workflow_dispatch (staged publish, 11 attempts) and this step was skipped, so the
+ # GitHub Release carried no SBOM until it was attached by hand from the run's
+ # `sbom-npm` artifact. Attach whenever a release for the published tag exists.
+ if: steps.resolve.outputs.skip != 'true' && (github.event_name == 'release' || github.event_name == 'workflow_dispatch')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- TAG: ${{ github.ref_name }}
- run: gh release upload "$TAG" sbom-npm.cdx.json --clobber
+ TAG: ${{ github.event_name == 'release' && github.ref_name || format('v{0}', inputs.version) }}
+ run: |
+ if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
+ echo "::notice::no GitHub Release for $TAG yet — SBOM stays on the sbom-npm workflow artifact"
+ exit 0
+ fi
+ gh release upload "$TAG" sbom-npm.cdx.json --repo "$GITHUB_REPOSITORY" --clobber
# WS1.2/WS1.3 (#7065 class): the artifact that is about to be published must
# BOOT. build:cli already assembled dist/ above; this packs+installs+boots the
diff --git a/changelog.d/fixes/v3850-sbom-attach-on-dispatch.md b/changelog.d/fixes/v3850-sbom-attach-on-dispatch.md
new file mode 100644
index 0000000000..95f3162263
--- /dev/null
+++ b/changelog.d/fixes/v3850-sbom-attach-on-dispatch.md
@@ -0,0 +1 @@
+- npm publish workflow: the CycloneDX SBOM is attached to the GitHub Release on `workflow_dispatch` publishes too (when a release for the tag exists), not only on the `release` event — v3.8.50 shipped through a staged dispatch and its release carried no SBOM until it was attached by hand from the run's `sbom-npm` artifact