remove_deploy_preview.yml 982 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Removedeploypreview
  2. permissions:
  3. contents: read
  4. statuses: write
  5. pull-requests: write
  6. env:
  7. VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
  8. VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
  9. VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
  10. on:
  11. pull_request_target:
  12. types:
  13. - closed
  14. jobs:
  15. delete-deployments:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v2
  19. - name: Extract branch name
  20. shell: bash
  21. run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
  22. id: extract_branch
  23. - name: Hash branch name
  24. uses: pplanel/hash-calculator-action@v1.3.1
  25. id: hash_branch
  26. with:
  27. input: ${{ steps.extract_branch.outputs.branch }}
  28. method: MD5
  29. - name: Call the delete-deployment-preview.sh script
  30. env:
  31. META_TAG: ${{ steps.hash_branch.outputs.digest }}
  32. run: |
  33. bash ./scripts/delete-deployment-preview.sh