File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313jobs :
1414 deploy :
15+ # workflow_run has no github.event.pull_request; pull_requests[0].number matches
16+ # github.event.pull_request.number from the PR Preview Validate run.
1517 if : >-
1618 github.event.workflow_run.conclusion == 'success' &&
17- github.event.workflow_run.event == 'pull_request'
19+ github.event.workflow_run.event == 'pull_request' &&
20+ github.event.workflow_run.pull_requests[0].number != null
1821 runs-on : ubuntu-latest
1922 timeout-minutes : 5
2023 environment : Cloudflare Pages
24+ env :
25+ PR_NUMBER : ${{ github.event.workflow_run.pull_requests[0].number }}
2126 permissions :
2227 contents : read
2328 deployments : write
4651 command : >-
4752 pages deploy site
4853 --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }}
49- --branch=${{ github.event.workflow_run.head_branch }}
54+ --branch=pr- ${{ env.PR_NUMBER }}
5055 gitHubToken : ${{ secrets.GITHUB_TOKEN }}
5156 # - name: Deploy to Cloudflare Pages
5257 # uses: andykenward/github-actions-cloudflare-pages@v3.0.0
You can’t perform that action at this time.
0 commit comments