Skip to content

Commit 10f79fa

Browse files
authored
fix(release): preserve branch context for publishing (#11004)
2 parents de14bef + 683925c commit 10f79fa

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ jobs:
164164
persist-credentials: false
165165
ref: ${{ github.event.pull_request.merge_commit_sha }}
166166
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
167+
- name: Restore main branch context
168+
env:
169+
TARGET_SHA: ${{ github.event.pull_request.merge_commit_sha }}
170+
run: |
171+
git switch --force-create main "${TARGET_SHA}"
172+
git branch --set-upstream-to=origin/main main
167173
- name: Validate release app token
168174
if: steps.app-token.outputs.token == ''
169175
run: |

0 commit comments

Comments
 (0)