ci: add one-off workflow to backfill size labels on open PRs (#1102)

A manually-dispatched workflow that fans out across all open PRs and
runs the size labeler against each. This is a one-time verification
of the labeler against the existing PR set; the workflow will be
removed in a follow-up after it runs.

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Neil 2026-04-25 17:30:44 -07:00 committed by GitHub
parent b96dc93d72
commit 64c77d735a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
# One-off workflow to backfill size labels on all open PRs.
# Runs cbrgm/pr-size-labeler-action against each open PR number via matrix.
# Delete this file after the backfill completes.
name: PR Size Labeler (backfill)
on:
workflow_dispatch:
permissions:
pull-requests: write
contents: read
jobs:
enumerate:
runs-on: ubuntu-latest
outputs:
prs: ${{ steps.list.outputs.prs }}
steps:
- name: List open PR numbers
id: list
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prs=$(gh pr list --repo "${{ github.repository }}" --state open --limit 500 --json number --jq '[.[].number]')
echo "Found PRs: $prs"
echo "prs=$prs" >> "$GITHUB_OUTPUT"
label:
needs: enumerate
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
pr: ${{ fromJSON(needs.enumerate.outputs.prs) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Label PR ${{ matrix.pr }} based on size
uses: cbrgm/pr-size-labeler-action@v1.3.7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repository: ${{ github.repository }}
github_pr_number: ${{ matrix.pr }}
config_file_path: .github/pull-request-size.yml