Skip to content

Commit 50f5ed4

Browse files
authored
Update main.yml
1 parent fbd351e commit 50f5ed4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/main.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@ jobs:
1515

1616
# Your build and deployment steps go here
1717

18+
- name: Find project ID
19+
id: project_id
20+
run: |
21+
project_id=$(curl -sSf -X GET "https://api.vercel.com/v8/projects" \
22+
-H "Authorization: Bearer 4EMYs0YWWJQrhQYIVDGzIFkR" \
23+
-H "Content-Type: application/json" \
24+
| jq -r '.[] | select(.name == "ut-bot-deploy") | .id')
25+
echo "::set-output name=project_id::$project_id"
26+
1827
- name: Find latest deployment
1928
id: latest_deployment
2029
run: |
21-
latest_deployment=$(curl -sSf -X GET "https://api.vercel.com/v12/now/deployments?projectId=ut-bot-deploy&limit=1" \
30+
latest_deployment=$(curl -sSf -X GET "https://api.vercel.com/v12/now/deployments?projectId=${{ steps.project_id.outputs.project_id }}&limit=1" \
2231
-H "Authorization: Bearer 4EMYs0YWWJQrhQYIVDGzIFkR" \
2332
-H "Content-Type: application/json" \
2433
| jq -r '.deployments[0].uid')
@@ -27,7 +36,7 @@ jobs:
2736
- name: Wait for Deployment
2837
run: |
2938
# Command to check the deployment status
30-
while [[ "$(curl -sSf -X GET "https://api.vercel.com/v3/deployments/ut-bot-deploy/events" \
39+
while [[ "$(curl -sSf -X GET "https://api.vercel.com/v3/deployments/${{ steps.latest_deployment.outputs.deployment_id }}/events" \
3140
-H "Authorization: Bearer 4EMYs0YWWJQrhQYIVDGzIFkR" \
3241
-H "Content-Type: application/json" \
3342
| grep -c 'READY')" -eq 0 ]]; do

0 commit comments

Comments
 (0)