diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 84b32f3c..3984b530 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -9,9 +9,6 @@ on: pr_number: description: 'Pull Request number to deploy preview for' required: true - pr_branch: - description: 'The branch name to deploy' - required: true jobs: build: @@ -33,17 +30,15 @@ jobs: run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "PR_NUMBER=${{ github.event.inputs.pr_number }}" >> $GITHUB_ENV - echo "PR_BRANCH=${{ github.event.inputs.pr_branch }}" >> $GITHUB_ENV else echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV - echo "PR_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV fi # Now check out the PR’s head branch (whether from a PR event or supplied manually) - name: Checkout PR branch uses: actions/checkout@v4 with: - ref: ${{ env.PR_BRANCH }} + ref: "refs/pull/${{ env.PR_NUMBER }}/merge" - name: Setup Node.js uses: actions/setup-node@v4