From f71052df0137d8a60f98c2121495ef4cc9343727 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 27 Nov 2024 11:34:44 +0000 Subject: [PATCH] ci: fetch changeset base branch when snapshot (#12508) * ci: fetch changeset base branch * Update .github/workflows/snapshot-release.yml Co-authored-by: Bjorn Lu * Remove redundant changeset pre exit command * Fix indentation in snapshot-release workflow --------- Co-authored-by: Bjorn Lu --- .github/workflows/snapshot-release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index ae8d3060fa82..612ca32a7454 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -63,7 +63,13 @@ jobs: ref: ${{ steps.refs.outputs.head_ref }} fetch-depth: 0 - - run: git fetch origin main:main + - name: Extract base branch from .changeset/config.json + id: getBaseBranch + run: | + baseBranch=$(jq -r '.baseBranch' .changeset/config.json) + echo "baseBranch=${baseBranch}" >> $GITHUB_OUTPUT + + - run: git fetch origin ${{ steps.getBaseBranch.outputs.baseBranch }}:${{ steps.getBaseBranch.outputs.baseBranch }} - name: Setup PNPM uses: pnpm/action-setup@v3