Skip to content

Commit 1f591f2

Browse files
authored
Update main.yml
1 parent 6c31da1 commit 1f591f2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/main.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@ jobs:
1818
- name: Find latest deployment
1919
id: latest_deployment
2020
run: |
21-
latest_deployment_url=$(curl -sSf -X GET "https://api.vercel.com/v6/now/deployments?projectId=ut-bot-deploy&limit=1" \
21+
latest_deployment_id=$(curl -sSf -X GET "https://api.vercel.com/v6/deployments?projectId=ut-bot-deploy&limit=1" \
2222
-H "Authorization: Bearer 4EMYs0YWWJQrhQYIVDGzIFkR" \
2323
-H "Content-Type: application/json" \
24-
| jq -r '.deployments[0].url')
24+
| jq -r '.deployments[0].uid')
25+
echo "::set-output name=deployment_id::$latest_deployment_id"
26+
latest_deployment_url=$(curl -sSf -X GET "https://api.vercel.com/v6/deployments/${latest_deployment_id}" \
27+
-H "Authorization: Bearer 4EMYs0YWWJQrhQYIVDGzIFkR" \
28+
-H "Content-Type: application/json" \
29+
| jq -r '.url')
2530
echo "::set-output name=deployment_url::$latest_deployment_url"
2631
2732
- name: Wait for Deployment
2833
run: |
29-
deployment_url="${{ steps.latest_deployment.outputs.deployment_url }}"
34+
deployment_id="${{ steps.latest_deployment.outputs.deployment_id }}"
3035
# Command to wait for the deployment to be ready
31-
while ! curl -sSLf "${deployment_url}" >/dev/null; do
36+
while [[ "$(curl -sSf -X GET "https://api.vercel.com/v6/deployments/${deployment_id}" \
37+
-H "Authorization: Bearer 4EMYs0YWWJQrhQYIVDGzIFkR" \
38+
-H "Content-Type: application/json" \
39+
| jq -r '.ready')" != "true" ]]; do
3240
sleep 30
3341
done
3442

0 commit comments

Comments
 (0)