From 2e5f323a7db0568b689bd47bbbb2b7a8fc1ab756 Mon Sep 17 00:00:00 2001 From: sherwinski Date: Wed, 24 Jun 2026 14:01:37 -0700 Subject: [PATCH 1/2] fix: create GitHub release against the v-prefixed tag The shared github-release workflow used a single version value for both the release name and the git tag_name. This repo passed the bare version (e.g. 3.9.1), so createRelease targeted a non-existent "3.9.1" tag and would create a stray tag off the default branch instead of using the real "v3.9.1" tag. Replace the shared-workflow call in both publish-svn workflows with an inline github-script job that tags the release with the v-prefixed ref (github.ref_name) while keeping the bare version as the release title, preserves the merged-release- PR notes behavior, and skips if a release for the tag already exists. --- .github/workflows/publish-svn-v2.yml | 44 ++++++++++++++++++++++++---- .github/workflows/publish-svn.yml | 44 ++++++++++++++++++++++++---- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-svn-v2.yml b/.github/workflows/publish-svn-v2.yml index 598dc1a..ce8a219 100644 --- a/.github/workflows/publish-svn-v2.yml +++ b/.github/workflows/publish-svn-v2.yml @@ -126,11 +126,45 @@ jobs: github-release: needs: publish + runs-on: ubuntu-latest permissions: contents: write pull-requests: read - uses: OneSignal/sdk-shared/.github/workflows/github-release.yml@main - with: - version: ${{ needs.publish.outputs.bare_version }} - secrets: - GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }} + steps: + - name: Create GitHub Release + uses: actions/github-script@v9 + env: + TAG: ${{ github.ref_name }} + VERSION: ${{ needs.publish.outputs.bare_version }} + with: + github-token: ${{ secrets.GH_PUSH_TOKEN || github.token }} + script: | + // Tags are v-prefixed (e.g. v2.4.6); releases are titled with the bare version (e.g. 2.4.6). + const tag = process.env.TAG; + const version = process.env.VERSION; + const { owner, repo } = context.repo; + + try { + await github.rest.repos.getReleaseByTag({ owner, repo, tag }); + core.info(`Release for ${tag} already exists; skipping.`); + return; + } catch (e) { + if (e.status !== 404) throw e; + } + + const prs = await github.rest.pulls.list({ + owner, repo, state: 'closed', sort: 'updated', direction: 'desc', per_page: 50, + }); + const releasePr = prs.data.find(pr => + pr.merged_at && pr.title.replace(/^chore:\s*/i, '').startsWith(`Release ${version}`) + ); + const body = releasePr ? releasePr.body.split('