diff options
author | 2025-02-11 16:10:37 +0000 | |
---|---|---|
committer | 2025-02-11 16:10:37 +0000 | |
commit | 7d94b49870b9258e1ab242c5410cf6da20b5c78b (patch) | |
tree | 534d1d751e263e9b12cd7af33669cfe0a138d4ce | |
parent | 8d68ac4b5c13aaf37e86a08a7a4d6c88f08d5cde (diff) | |
download | astro-7d94b49870b9258e1ab242c5410cf6da20b5c78b.tar.gz astro-7d94b49870b9258e1ab242c5410cf6da20b5c78b.tar.zst astro-7d94b49870b9258e1ab242c5410cf6da20b5c78b.zip |
ci: trick changesets to use the correct ref (#13220)
Co-authored-by: ascorbic <213306+ascorbic@users.noreply.github.com>
-rw-r--r-- | .github/workflows/preview-release.yml | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index f3542edd1..6a3a967ce 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -37,9 +37,26 @@ jobs: steps: - name: Disable git crlf run: git config --global core.autocrlf false - - - name: Checkout - uses: actions/checkout@v4 + + + - name: resolve pr refs + id: refs + uses: eficode/resolve-pr-refs@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@v4 + with: + ref: ${{ steps.refs.outputs.head_ref }} + fetch-depth: 0 + + - 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 |