Skip to content

Squad PR Readiness #1893

Squad PR Readiness

Squad PR Readiness #1893

name: Squad PR Readiness
on:
pull_request_target:
branches: [dev, main, insider]
types: [opened, synchronize, reopened, edited, ready_for_review]
workflow_run:
workflows: ["Squad CI"]
types: [completed]
# NOTE: Using pull_request_target so we get a write token even for fork PRs.
# This is safe because we never check out or execute PR code — all data
# comes from the GitHub API.
permissions:
contents: read
pull-requests: write
issues: write
statuses: read
checks: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.workflow_run.pull_requests[0].number }}
cancel-in-progress: true
jobs:
readiness:
runs-on: ubuntu-latest
timeout-minutes: 5
# Skip bots, and skip workflow_run events with no associated PR
if: >-
github.actor != 'dependabot[bot]'
&& (github.event_name != 'workflow_run'
|| github.event.workflow_run.pull_requests[0] != null)
steps:
- name: Checkout scripts
uses: actions/checkout@v7
with:
sparse-checkout: scripts/pr-readiness.mjs
sparse-checkout-cone-mode: false
- name: Check PR readiness
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number || github.event.workflow_run.pull_requests[0].number }}
PR_AUTHOR: ${{ github.event.pull_request.user.login || github.event.workflow_run.actor.login }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref || github.event.workflow_run.pull_requests[0].base.ref }}
PR_DRAFT: ${{ github.event.pull_request.draft || 'false' }}
PR_LABELS: ${{ toJson(github.event.pull_request.labels) }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
RUN_NAME: ${{ github.workflow }}
run: node scripts/pr-readiness.mjs