From 3532a7f4bedf66bfbd8f66ffe222b27412ad875d Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Fri, 5 Jun 2026 21:11:49 +0300 Subject: [PATCH] fix(ci): auto-dispatch npm publish when release-please creates releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/release-please.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 093e2f14..0256c091 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -7,6 +7,7 @@ on: permissions: contents: write pull-requests: write + actions: write jobs: release: @@ -17,3 +18,13 @@ jobs: with: config-file: release-please-config.json manifest-file: .release-please-manifest.json + - name: Dispatch npm publish for released packages + if: ${{ steps.release.outputs.releases_created == 'true' }} + env: + GH_TOKEN: ${{ github.token }} + RELEASE_OUTPUTS: ${{ toJSON(steps.release.outputs) }} + run: | + for tag in $(echo "$RELEASE_OUTPUTS" | jq -r 'to_entries[] | select(.key | endswith("--tag_name")) | .value'); do + echo "Dispatching publish-package.yml for $tag" + gh workflow run publish-package.yml --repo "$GITHUB_REPOSITORY" -f tag="$tag" + done