From a08bd120b76d153d9555aa799000190e7d336642 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Nakazone Batista Date: Fri, 29 Dec 2023 03:51:38 -0300 Subject: [PATCH] Final Adjustment --- .github/workflows/vercel-cleanup-pr.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/vercel-cleanup-pr.yml b/.github/workflows/vercel-cleanup-pr.yml index 173a9a9..082202f 100644 --- a/.github/workflows/vercel-cleanup-pr.yml +++ b/.github/workflows/vercel-cleanup-pr.yml @@ -2,6 +2,7 @@ name: vercel-cleanup-pr on: pull_request: + types: [closed] env: VERCEL_CLI_TOKEN: ${{ secrets.VERCEL_CLI_TOKEN }} @@ -17,11 +18,10 @@ jobs: closed_deployments=$(curl "https://api.vercel.com/v6/deployments?projectId=$VERCEL_PROJECT_ID" \ -H "Accept: application/json" \ -H "Authorization: Bearer ${VERCEL_CLI_TOKEN}" | jq -r ".deployments[] | select(.meta.githubPrId == \"${GITHUB_PR_ID}\") | .uid") - echo "PR: $GITHUB_PR_ID" for deployment in $closed_deployments; do echo "Deleting Deployment: $deployment" - # curl "https://api.vercel.com/v6/now/deployments/$deployment" \ - # -X DELETE \ - # -H "Authorization: Bearer ${VERCEL_CLI_TOKEN}" + curl "https://api.vercel.com/v6/now/deployments/$deployment" \ + -X DELETE \ + -H "Authorization: Bearer ${VERCEL_CLI_TOKEN}" done