Commit 84786a1
authored
fix(ci): pass --ref tag to publish workflow dispatches (#1124)
## Summary
- **release.yml**: Pass `--ref $TAG` to all `gh workflow run` calls so
`GITHUB_REF` points to the release tag instead of `refs/heads/main`
- **publish-js.yml**: Add resilient dist-tag detection that falls back
to checking `package.json` version format when `GITHUB_REF` isn't a tag
## Problem
npm `latest` tag has been stuck at 0.1.10 since v0.1.11. All subsequent
versions (0.1.11–0.1.14) were published under the `next` dist-tag
instead.
**Root cause**: `release.yml` dispatches publish workflows via `gh
workflow run` without `--ref`. The `release: [published]` event doesn't
fire because GitHub prevents recursive workflow triggers from
`GITHUB_TOKEN`. Without `--ref`, `GITHUB_REF` defaults to
`refs/heads/main`, and `publish-js.yml` classifies that as a pre-release
→ `--tag next`.
## Test plan
- [ ] Verify `release.yml` passes `--ref $TAG` to all three publish
workflow dispatches
- [ ] Verify `publish-js.yml` determines `latest` tag when `GITHUB_REF`
is a version tag
- [ ] Verify `publish-js.yml` falls back to `latest` when `package.json`
has stable semver
- [ ] Ship v0.1.16 release to confirm npm `latest` tag updates correctly1 parent 972ab2d commit 84786a1
2 files changed
+31
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
399 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
400 | 407 | | |
401 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
402 | 420 | | |
403 | 421 | | |
404 | | - | |
405 | | - | |
| 422 | + | |
406 | 423 | | |
407 | 424 | | |
408 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
0 commit comments