Skip to content

Commit 3532a7f

Browse files
abbaseyaclaude
andcommitted
fix(ci): auto-dispatch npm publish when release-please creates releases
Releases created by release-please use the default GITHUB_TOKEN, and GitHub does not fire `on: release` workflows for events created with that token — so publish-package.yml never auto-ran and every npm publish had to be dispatched manually. workflow_dispatch is an explicit exception to that rule, so the release job now dispatches the existing publish-package.yml (the single publishing path) once per released tag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ad72e7d commit 3532a7f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
permissions:
88
contents: write
99
pull-requests: write
10+
actions: write
1011

1112
jobs:
1213
release:
@@ -17,3 +18,13 @@ jobs:
1718
with:
1819
config-file: release-please-config.json
1920
manifest-file: .release-please-manifest.json
21+
- name: Dispatch npm publish for released packages
22+
if: ${{ steps.release.outputs.releases_created == 'true' }}
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
RELEASE_OUTPUTS: ${{ toJSON(steps.release.outputs) }}
26+
run: |
27+
for tag in $(echo "$RELEASE_OUTPUTS" | jq -r 'to_entries[] | select(.key | endswith("--tag_name")) | .value'); do
28+
echo "Dispatching publish-package.yml for $tag"
29+
gh workflow run publish-package.yml --repo "$GITHUB_REPOSITORY" -f tag="$tag"
30+
done

0 commit comments

Comments
 (0)