Skip to content

Commit 0141aba

Browse files
committed
fix
1 parent 81ac155 commit 0141aba

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

.github/workflows/preview.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ jobs:
2222
run: |
2323
deployment_id=$(gh api "/repos/${{ github.repository }}/deployments" \
2424
-X POST \
25-
-H "Accept: application/vnd.github+json" \
26-
-H "X-GitHub-Api-Version: 2022-11-28" \
27-
-f ref="${{ github.event.pull_request.head.ref }}" \
28-
-f environment="preview-${{ github.event.pull_request.number }}" \
29-
-f description="Preview deployment for PR ${{ github.event.pull_request.number }}" \
30-
-f auto_merge=false \
31-
-f required_contexts='[]' \
25+
-H 'Accept: application/vnd.github+json' \
26+
-H 'X-GitHub-Api-Version: 2022-11-28' \
27+
-f 'ref=${{ github.event.pull_request.head.ref }}' \
28+
-f 'environment=preview-${{ github.event.pull_request.number }}' \
29+
-f 'description=Preview deployment for PR ${{ github.event.pull_request.number }}' \
30+
-f 'auto_merge=false' \
31+
-f 'required_contexts=[]' \
3232
--jq '.id')
3333
3434
gh api "/repos/${{ github.repository }}/deployments/$deployment_id/statuses" \
3535
-X POST \
36-
-H "Accept: application/vnd.github+json" \
37-
-H "X-GitHub-Api-Version: 2022-11-28" \
38-
-f state="in_progress" \
39-
-f description="Deployment created" \
40-
-f log_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}"
36+
-H 'Accept: application/vnd.github+json' \
37+
-H 'X-GitHub-Api-Version: 2022-11-28' \
38+
-f 'state=in_progress' \
39+
-f 'description=Deployment created' \
40+
-f 'log_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}'
4141
4242
echo "id=$deployment_id" >> $GITHUB_OUTPUT
4343
@@ -83,12 +83,12 @@ jobs:
8383
run: |
8484
gh api "/repos/${{ github.repository }}/deployments/${{ steps.deployment.outputs.id }}/statuses" \
8585
-X POST \
86-
-H "Accept: application/vnd.github+json" \
87-
-H "X-GitHub-Api-Version: 2022-11-28" \
88-
-f state="success" \
89-
-f description="Deployment completed" \
90-
-f environment_url="https://d2euvt1bxklciq.cloudfront.net/${{ github.repository }}/pull/${{ github.event.pull_request.number}}" \
91-
-f log_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}"
86+
-H 'Accept: application/vnd.github+json' \
87+
-H 'X-GitHub-Api-Version: 2022-11-28' \
88+
-f 'state=success' \
89+
-f 'description=Deployment completed' \
90+
-f 'environment_url=https://d2euvt1bxklciq.cloudfront.net/${{ github.repository }}/pull/${{ github.event.pull_request.number}}' \
91+
-f 'log_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}'
9292
9393
- name: Update Deployment Status on Failure
9494
if: failure() && steps.deployment.outputs.id
@@ -97,8 +97,8 @@ jobs:
9797
run: |
9898
gh api "/repos/${{ github.repository }}/deployments/${{ steps.deployment.outputs.id }}/statuses" \
9999
-X POST \
100-
-H "Accept: application/vnd.github+json" \
101-
-H "X-GitHub-Api-Version: 2022-11-28" \
102-
-f state="failure" \
103-
-f description="Deployment failed" \
104-
-f log_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}"
100+
-H 'Accept: application/vnd.github+json' \
101+
-H 'X-GitHub-Api-Version: 2022-11-28' \
102+
-f 'state=failure' \
103+
-f 'description=Deployment failed' \
104+
-f 'log_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}?pr=${{ github.event.pull_request.number }}'

0 commit comments

Comments
 (0)