Skip to content

P/L w/ or w/o fees toggle #528

P/L w/ or w/o fees toggle

P/L w/ or w/o fees toggle #528

name: Clean Stale Preview Apps
on:
pull_request:
types:
- closed
- synchronize
jobs:
Clean:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
VERCEL_PROJECT: ${{ secrets.VERCEL_PROJECT }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Export env vars
run: |
echo "BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
echo "TARGET=$(echo preview)" >> $GITHUB_ENV
if [ ${{ github.event.action }} == 'synchronize' ]; then
echo "STATE=$(echo ERROR,READY,CANCELED)" >> $GITHUB_ENV
elif [ ${{ github.event.action }} == 'closed' ]; then
echo "STATE=$(echo BUILDING,ERROR,INITIALIZING,QUEUED,READY,CANCELED)" >> $GITHUB_ENV
fi
- name: Clean stale apps
shell: bash
run: ./.github/scripts/clean_deployments.sh