From 85f78cb54b10edeb28cc8ffce8f12d964d0e8161 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Fri, 22 Nov 2024 15:01:13 +0000 Subject: [PATCH 1/4] ci: fetch changeset base branch --- .github/workflows/snapshot-release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index ae8d3060fa82..93b7cc7db095 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_ENV + + - run: git fetch origin ${{ env.baseBranch }}:${{ env.baseBranch }} - name: Setup PNPM uses: pnpm/action-setup@v3 @@ -84,6 +90,8 @@ jobs: - name: Bump Package Versions id: changesets run: | + # Snapshots don't work in pre mode. See https://github.com/changesets/changesets/issues/1195 + pnpm exec changeset pre exit || true pnpm exec changeset status --output status.output.json 2>&1 # Snapshots don't work in pre mode. See https://github.com/changesets/changesets/issues/1195 pnpm exec changeset pre exit || true From fcf096cfb56193b6082f8a34d8539c8d7560d3c1 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 27 Nov 2024 11:29:43 +0000 Subject: [PATCH 2/4] Update .github/workflows/snapshot-release.yml Co-authored-by: Bjorn Lu --- .github/workflows/snapshot-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index 93b7cc7db095..eab274f40ce7 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -67,9 +67,9 @@ jobs: id: getBaseBranch run: | baseBranch=$(jq -r '.baseBranch' .changeset/config.json) - echo "baseBranch=${baseBranch}" >> $GITHUB_ENV + echo "baseBranch=${baseBranch}" >> $GITHUB_OUTPUT - - run: git fetch origin ${{ env.baseBranch }}:${{ env.baseBranch }} + - run: git fetch origin ${{ steps.getBaseBranch.outputs.baseBranch }}:${{ steps.getBaseBranch.outputs.baseBranch }} - name: Setup PNPM uses: pnpm/action-setup@v3 From 3cdc7922c1ffd3bf52e4682d9f0d40e4bb4b2091 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 27 Nov 2024 11:30:18 +0000 Subject: [PATCH 3/4] Remove redundant changeset pre exit command --- .github/workflows/snapshot-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index eab274f40ce7..400d716eada3 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -90,8 +90,6 @@ jobs: - name: Bump Package Versions id: changesets run: | - # Snapshots don't work in pre mode. See https://github.com/changesets/changesets/issues/1195 - pnpm exec changeset pre exit || true pnpm exec changeset status --output status.output.json 2>&1 # Snapshots don't work in pre mode. See https://github.com/changesets/changesets/issues/1195 pnpm exec changeset pre exit || true From 0bb5594f621abe7f016483789daf4339887de099 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 27 Nov 2024 11:33:35 +0000 Subject: [PATCH 4/4] Fix indentation in snapshot-release workflow --- .github/workflows/snapshot-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index 400d716eada3..612ca32a7454 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -69,7 +69,7 @@ jobs: baseBranch=$(jq -r '.baseBranch' .changeset/config.json) echo "baseBranch=${baseBranch}" >> $GITHUB_OUTPUT - - run: git fetch origin ${{ steps.getBaseBranch.outputs.baseBranch }}:${{ steps.getBaseBranch.outputs.baseBranch }} + - run: git fetch origin ${{ steps.getBaseBranch.outputs.baseBranch }}:${{ steps.getBaseBranch.outputs.baseBranch }} - name: Setup PNPM uses: pnpm/action-setup@v3