Skip to content

Commit 28058ad

Browse files
committed
Test deploy preview using PR merge commit
1 parent eec356d commit 28058ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/deploy-preview.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,18 @@ jobs:
3030
GH_REPO: ${{ github.repository }}
3131
GH_TOKEN: ${{ secrets.GH_TOKEN_MANAGE_ENVS }}
3232
run: |
33-
ref=$(gh pr view ${{ github.event.inputs.issue }} --json headRefOid -q .headRefOid)
33+
ref=$(gh pr view ${{ github.event.inputs.issue }} --json potentialMergeCommit -q .potentialMergeCommit.oid)
3434
env=staging-${{ github.event.inputs.issue }}
3535
url=https://$env.cmbuckley.co.uk
3636
echo "url=$url" >> $GITHUB_OUTPUT
3737
3838
# create environment, deployment and success status
3939
gh api -X PUT repos/{owner}/{repo}/environments/$env
40-
deployment=$(gh api repos/{owner}/{repo}/deployments \
40+
deployment=$(gh api repos/{owner}/{repo}/deployments -q .id \
4141
-f ref=$ref \
4242
-f environment=$env \
43-
-F required_contexts[]=netlify/{owner}/deploy-preview -q .id)
43+
-F auto_merge=false
44+
-F required_contexts[]=netlify/{owner}/deploy-preview)
4445
gh api -X POST repos/{owner}/{repo}/deployments/$deployment/statuses \
4546
-f state=success \
4647
-f environment_url=$url

0 commit comments

Comments
 (0)