diff --git a/.changeset/fix-marketplace-tag-on-main.md b/.changeset/fix-marketplace-tag-on-main.md new file mode 100644 index 00000000000..ffd0c59bd02 --- /dev/null +++ b/.changeset/fix-marketplace-tag-on-main.md @@ -0,0 +1,7 @@ +--- +"roo-code-2": patch +--- + +Fix release tags being created off `main`. + +The marketplace publish workflow resolved `GIT_REF` from the pull request's `head.sha`. On a squash merge that head commit becomes an orphan, so the release tag (`git tag` on the checked-out ref) was created outside `main`'s history. `GIT_REF` now uses `merge_commit_sha`, which points at the commit actually on `main` for both merge and squash strategies, keeping every release tag on `main`. Also added a `merged == true` guard so the publish job never runs for a closed-but-unmerged PR. diff --git a/.github/workflows/marketplace-publish.yml b/.github/workflows/marketplace-publish.yml index 7d1ed13996e..5f6e9a96eb0 100644 --- a/.github/workflows/marketplace-publish.yml +++ b/.github/workflows/marketplace-publish.yml @@ -6,7 +6,11 @@ on: workflow_dispatch: env: - GIT_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'main' }} + # Use the PR's merge_commit_sha (the commit actually on `main` after squash/merge) + # instead of head.sha. On a squash merge the head commit becomes an orphan, which + # previously caused the release tag to be created off `main`. merge_commit_sha points + # at the commit on `main` for both merge and squash strategies, keeping tags on `main`. + GIT_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.merge_commit_sha || 'main' }} jobs: publish-extension: @@ -15,6 +19,7 @@ jobs: contents: write # Required for pushing tags. if: > ( github.event_name == 'pull_request' && + github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.title, 'Changeset version bump') ) || github.event_name == 'workflow_dispatch'