From 24947365a9f7d7b589faea2e618985f0e9d61a92 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Nakazone Batista Date: Fri, 29 Dec 2023 03:50:01 -0300 Subject: [PATCH] Fixes PR Cleanup --- .github/workflows/vercel-cleanup-pr.yml | 10 +++++----- .github/workflows/vercel-cleanup-previous-preview.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/vercel-cleanup-pr.yml b/.github/workflows/vercel-cleanup-pr.yml index 2138d0c..173a9a9 100644 --- a/.github/workflows/vercel-cleanup-pr.yml +++ b/.github/workflows/vercel-cleanup-pr.yml @@ -2,12 +2,11 @@ name: vercel-cleanup-pr on: pull_request: - types: [closed] env: VERCEL_CLI_TOKEN: ${{ secrets.VERCEL_CLI_TOKEN }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} - GITHUB_PR_ID: ${{github.event.pull_request.number}} + GITHUB_PR_ID: ${{ github.event.number }} jobs: cleanup: @@ -18,10 +17,11 @@ 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 diff --git a/.github/workflows/vercel-cleanup-previous-preview.yml b/.github/workflows/vercel-cleanup-previous-preview.yml index 1df8114..0906850 100644 --- a/.github/workflows/vercel-cleanup-previous-preview.yml +++ b/.github/workflows/vercel-cleanup-previous-preview.yml @@ -10,7 +10,7 @@ on: env: VERCEL_CLI_TOKEN: ${{ secrets.VERCEL_CLI_TOKEN }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} - GIT_PREVIOS_COMMIT: ${{github.event.before}} + GIT_PREVIOS_COMMIT: ${{ github.event.before }} jobs: