From dbb168c255a267a9214f09e7d4882ffcce361b68 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 25 Mar 2026 11:49:34 -0700 Subject: [PATCH] Add assignee check to PR metadata workflow Also trigger on assigned/unassigned events and report missing assignees alongside the existing label and milestone checks. Made-with: Cursor --- .github/workflows/pr-metadata-check.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-metadata-check.yml b/.github/workflows/pr-metadata-check.yml index db2114f0c1..e1e2b4d5fc 100644 --- a/.github/workflows/pr-metadata-check.yml +++ b/.github/workflows/pr-metadata-check.yml @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -name: "CI: Enforce label/milestone on PRs" +name: "CI: Enforce assignee/label/milestone on PRs" on: pull_request_target: @@ -10,6 +10,8 @@ on: - opened - edited - synchronize + - assigned + - unassigned - labeled - unlabeled - reopened @@ -17,12 +19,13 @@ on: jobs: check-metadata: - name: PR has labels and milestone + name: PR has assignee, labels, and milestone if: github.repository_owner == 'NVIDIA' runs-on: ubuntu-latest steps: - - name: Check for labels and milestone + - name: Check for assignee, labels, and milestone env: + ASSIGNEES: ${{ toJson(github.event.pull_request.assignees) }} LABELS: ${{ toJson(github.event.pull_request.labels) }} MILESTONE: ${{ github.event.pull_request.milestone && github.event.pull_request.milestone.title || '' }} PR_URL: ${{ github.event.pull_request.html_url }} @@ -34,11 +37,16 @@ jobs: exit 0 fi - LABEL_NAMES=$(echo "$LABELS" | jq -r '.[].name') ERRORS="" + ASSIGNEE_COUNT=$(echo "$ASSIGNEES" | jq 'length') + if [ "$ASSIGNEE_COUNT" -eq 0 ]; then + ERRORS="${ERRORS}- **Missing assignee**: assign at least one person to this PR.\n" + fi + # Module labels identify which package the PR touches. # Cross-cutting labels exempt PRs from needing a module label. + LABEL_NAMES=$(echo "$LABELS" | jq -r '.[].name') MODULE_LABELS="cuda.bindings cuda.core cuda.pathfinder" MODULE_EXEMPT_LABELS="CI/CD" HAS_MODULE=false @@ -98,10 +106,12 @@ jobs: exit 1 fi + ASSIGNEE_LIST=$(echo "$ASSIGNEES" | jq -r '.[].login' | paste -sd ', ' -) LABEL_LIST=$(echo "$LABEL_NAMES" | paste -sd ', ' -) { echo "## PR Metadata Check Passed" echo "" + echo "- **Assignees**: $ASSIGNEE_LIST" echo "- **Labels**: $LABEL_LIST" echo "- **Milestone**: $MILESTONE" } >> "$GITHUB_STEP_SUMMARY"