From 77725b2e7d56a70ee843f08d02ad92799bd000d8 Mon Sep 17 00:00:00 2001 From: Ola Adebayo Date: Mon, 2 Mar 2026 18:52:19 +0000 Subject: [PATCH] fix(ci): handle grouped release PRs where release-please fails to tag - Add `npm_tags_created` output to `recover-stale-releases` job so downstream jobs can detect when the recovery path created tags - Use `npm_tags_created` as a fallback signal for NPM_PUBLISH alongside release-please's own `sdk--release_created` output - Remove `${version}` token requirement from group-pull-request-title-pattern so validation passes for grouped PRs whose titles omit the version - Bump examples/todo-react deps to 0.1.7 to align with latest releases - Improve debug notice to log both RP and recover-path npm signals Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release-sdk.yml | 27 +++++++++++++++++++++++---- examples/todo-react/package.json | 8 ++++---- release-please-config.json | 2 +- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-sdk.yml b/.github/workflows/release-sdk.yml index 5fe677f..10f86fb 100644 --- a/.github/workflows/release-sdk.yml +++ b/.github/workflows/release-sdk.yml @@ -42,6 +42,8 @@ jobs: recover-stale-releases: name: Recover Stale Releases runs-on: ubuntu-latest + outputs: + npm_tags_created: ${{ steps.recover.outputs.npm_tags_created }} # Runs on every trigger but steps are conditioned on push events. # This ensures the job always succeeds (never "skipped"), so downstream # jobs can depend on it without if: always() — which breaks output propagation. @@ -52,6 +54,7 @@ jobs: fetch-depth: 0 - name: Create missing manifest tags and relabel stale PRs + id: recover if: github.event_name == 'push' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -89,6 +92,10 @@ jobs: fi done + # Signal that new npm package tags were created (release PR was merged + # but release-please failed to tag — common with grouped PRs). + echo "npm_tags_created=${TAGGED}" >> "$GITHUB_OUTPUT" + # If we just created tags, find any merged release PRs that are still # labeled 'autorelease: pending' and flip them to 'autorelease: tagged' # so that release-please no longer considers them untagged. @@ -135,7 +142,7 @@ jobs: fi done - for token in '${scope}' '${version}'; do + for token in '${scope}'; do if [[ "$group_pattern" != *"$token"* ]]; then echo "::error::group-pull-request-title-pattern must include $token" exit 1 @@ -171,8 +178,20 @@ jobs: echo "::notice::workflow_dispatch — npm_publish=${NPM_PUBLISH}, gateway_release_created=${GATEWAY_RELEASE_CREATED}, gateway_tag=${GATEWAY_TAG}" else # All npm packages use linked-versions, so sdk is representative. - # No fallback to releases_created — that includes gateway-only releases. - NPM_PUBLISH="${{ steps.release.outputs['sdk--release_created'] }}" + RP_NPM="${{ steps.release.outputs['sdk--release_created'] }}" + + # Fallback: release-please cannot create GitHub Releases from grouped + # PRs (the merged PR title lacks ${component}). When that happens the + # recover-stale-releases job still creates the git tags. Use its + # npm_tags_created output as a reliable signal that a release PR was + # merged and npm packages should be published. + RECOVER_NPM="${{ needs.recover-stale-releases.outputs.npm_tags_created }}" + + if [[ "$RP_NPM" == "true" || "$RECOVER_NPM" == "1" ]]; then + NPM_PUBLISH="true" + else + NPM_PUBLISH="" + fi { echo "releases_created=${{ steps.release.outputs.releases_created }}" @@ -182,7 +201,7 @@ jobs: echo "npm_publish=${NPM_PUBLISH}" } >> "$GITHUB_OUTPUT" - echo "::notice::push — releases_created=${{ steps.release.outputs.releases_created }}, npm_publish=${NPM_PUBLISH}, gateway=${{ steps.release.outputs['gateway--release_created'] }}" + echo "::notice::push — releases_created=${{ steps.release.outputs.releases_created }}, rp_npm=${RP_NPM}, recover_npm=${RECOVER_NPM}, npm_publish=${NPM_PUBLISH}, gateway=${{ steps.release.outputs['gateway--release_created'] }}" fi publish-npm: diff --git a/examples/todo-react/package.json b/examples/todo-react/package.json index 1e60b51..87bdb03 100644 --- a/examples/todo-react/package.json +++ b/examples/todo-react/package.json @@ -1,6 +1,6 @@ { "name": "rep-example-todo-react", - "version": "0.1.4", + "version": "0.1.7", "private": true, "description": "Example: Todo app showing REP gateway + React SDK integration", "scripts": { @@ -14,8 +14,8 @@ "rep:serve": "rep dev --port 3000 --env .env.local --static ./dist --hot-reload" }, "dependencies": { - "@rep-protocol/react": "^0.1.6", - "@rep-protocol/sdk": "^0.1.6", + "@rep-protocol/react": "^0.1.7", + "@rep-protocol/sdk": "^0.1.7", "react": "^18.3.0", "react-dom": "^18.3.0" }, @@ -23,7 +23,7 @@ "@types/react": "^18.3.0", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.0", - "@rep-protocol/cli": "^0.1.4", + "@rep-protocol/cli": "^0.1.7", "typescript": "^5.4.0", "vite": "^5.4.0" } diff --git a/release-please-config.json b/release-please-config.json index 108f39a..a7174e2 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -3,7 +3,7 @@ "release-type": "node", "bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": true, - "group-pull-request-title-pattern": "chore${scope}: release ${version}", + "group-pull-request-title-pattern": "chore${scope}: release", "pull-request-title-pattern": "chore${scope}: release ${component} ${version}", "include-component-in-tag": true, "plugins": [