From f630d355d81f685abc115d79477c30e7fb900c94 Mon Sep 17 00:00:00 2001 From: Harnoor Lal Date: Tue, 14 Apr 2026 00:22:25 -0700 Subject: [PATCH] ci: enforce test-plan task-list completion on PRs PR task lists exist to enforce verification discipline (every test run, every box checked before merge). Without enforcement, "complete the box" silently degrades into "merge anyway." This workflow fails on any unchecked task-list item in a PR body, blocking merge via required status check. Skip conditions: - Drafts (intentional WIP, not ready for review) The error message says "complete," not "complete or remove," because removing the checklist defeats the purpose. The obligation is doing the test, not editing the PR body. Tested locally against six representative PR body shapes (unchecked, all-checked, no list, empty body, indented unchecked, similar-looking non-task text). All behaved correctly. After merge, branch protection on main needs to be updated in repo settings to require the new task-list-completed check. --- .github/workflows/pr-task-list.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/pr-task-list.yml diff --git a/.github/workflows/pr-task-list.yml b/.github/workflows/pr-task-list.yml new file mode 100644 index 0000000..b58c6a0 --- /dev/null +++ b/.github/workflows/pr-task-list.yml @@ -0,0 +1,24 @@ +name: PR Task List + +on: + pull_request: + types: [opened, edited, synchronize, reopened, ready_for_review] + +jobs: + task-list-completed: + if: ${{ !github.event.pull_request.draft }} + runs-on: ubuntu-latest + timeout-minutes: 1 + steps: + - name: Check PR body for unchecked task-list items + env: + BODY: ${{ github.event.pull_request.body }} + run: | + if printf '%s\n' "$BODY" | grep -qE '^[[:space:]]*- \[ \]'; then + echo "::error::Test plan has unchecked items. All items must be completed before merge. Tests must be run and results verified." + echo "" + echo "Unchecked items found in PR body:" + printf '%s\n' "$BODY" | grep -nE '^[[:space:]]*- \[ \]' + exit 1 + fi + echo "All task-list items are checked."