Skip to content

Commit e520fbb

Browse files
committed
ci(release): gate release pipeline to version-shaped tags only
The `release: published` event fires for ANY GitHub release, including non-package releases that merely host assets — e.g. the `embed-v1` embedder-weights release this PR introduces (model-pins.ts pins its URLs). Creating that release triggered the full build → sign → npm-publish pipeline, which would have published every package to npm (OCH_NPM_PUBLISH_ENABLED is true). It was cancelled in time and built from main (not this branch), so nothing leaked, but the trigger must be filtered. Gate the `resolve` job (root of the chain; everything else `needs` it under a success() gate) to version-shaped tags only: `root-v*`, `cli-v*`, or bare `v*` (the release-please conventions). `workflow_call` / `workflow_dispatch` pass an explicit tag input and remain unaffected. A weights tag like `embed-v1` now skips the pipeline entirely.
1 parent 79ebc54 commit e520fbb

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ jobs:
6767
resolve:
6868
name: Resolve release tag + SHA
6969
runs-on: ubuntu-latest
70+
# Only run the package-release pipeline for version-shaped tags. The
71+
# `release: published` event also fires for non-package releases that
72+
# merely HOST assets — e.g. the `embed-v1` embedder-weights release
73+
# (see packages/embedder/src/model-pins.ts) — which must NOT build,
74+
# sign, or npm-publish anything. release-please tags are `root-v*`,
75+
# `cli-v*`, or a bare `v*`; `workflow_call`/`workflow_dispatch` pass an
76+
# explicit tag input and are always allowed.
77+
if: >-
78+
github.event_name != 'release'
79+
|| startsWith(github.event.release.tag_name, 'root-v')
80+
|| startsWith(github.event.release.tag_name, 'cli-v')
81+
|| startsWith(github.event.release.tag_name, 'v')
7082
outputs:
7183
tag: ${{ steps.t.outputs.tag }}
7284
sha: ${{ steps.t.outputs.sha }}

0 commit comments

Comments
 (0)