Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/fix-marketplace-tag-on-main.md
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 6 additions & 1 deletion .github/workflows/marketplace-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'
Expand Down
Loading