diff --git a/.github/workflows/skip-vercel-forks.yml b/.github/workflows/skip-vercel-forks.yml new file mode 100644 index 0000000000..051d6fdb41 --- /dev/null +++ b/.github/workflows/skip-vercel-forks.yml @@ -0,0 +1,34 @@ +name: Skip Vercel for Forks + +on: + status: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.context }} + cancel-in-progress: true + +permissions: {} + +jobs: + skip-vercel-authorization: + permissions: + statuses: write + if: > + github.event.state == 'failure' && + startsWith(github.event.context, 'Vercel') && + github.event.description == 'Authorization required to deploy.' + runs-on: ubuntu-latest + steps: + - name: Mark as skipped + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 + with: + script: | + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.payload.sha, + state: 'success', + context: context.payload.context, + description: '⏸️ Deploy skipped - fork PR awaiting authorization', + target_url: context.payload.target_url, + });