Skip to content

ci(dependabot): add workflow integrity verifier, PR triage workflow & maintainer merge CLI - #11

Merged
onimurasame merged 1 commit into
masterfrom
ci/dependabot-pr-automation
Nov 25, 2026
Merged

onimurasame merged 1 commit into
masterfrom
ci/dependabot-pr-automation

Conversation

@onimurasame

Copy link
Copy Markdown
Collaborator

Summary

Adds end-to-end automated testing, provenance verification, policy triage, and single-command CODEOWNER batch squash-merge tooling for Dependabot PRs while preserving require_code_owner_review: true on master.

Key Changes

  • Workflow & Supply-Chain Integrity Verifier (scripts/verify-workflows.mjs, npm run verify:workflows):
    • Enforces immutable 40-char commit SHA pinning and explicit least-privilege permissions: across every .github/workflows/*.yml file.
    • Guards against unsafe pull_request_target checkouts of PR head code.
    • Detects multi-subaction version skew (e.g., github/codeql-action/{init,autobuild,analyze} drift as seen in build(deps): bump github/codeql-action/analyze from 3.39.4 to 4.39.4 #5) and requires a matching github/codeql-action* group in .github/dependabot.yml.
    • Validates required GitHub Pages bundle files referenced in .github/workflows/pages.yml on PRs (even though pages.yml only deploys on push to master).
    • Supports --verify-remote-tags to verify pinned SHAs resolve to their declared upstream # vX.Y.Z Git tags.
    • Wired into the required verify job in .github/workflows/ci.yml.
  • Automated Dependabot PR Triage Workflow (.github/workflows/dependabot-triage.yml):
    • Runs on pull_request_target strictly for dependabot[bot] using only least-privilege GITHUB_TOKEN (never checks out untrusted PR head code, never bypasses CODEOWNERS).
    • Verifies Dependabot commit authorship & cryptographic signatures, file confinement, workflow lockstep, and upstream tag-to-SHA provenance.
    • Classifies per policy: eligible (github-actions patch/minor/major/grouped + npm patch/minor) vs manual review (npm major updates, maintainer changes, or integrity failures).
    • Syncs automerge-eligible / manual-review-required labels and posts an idempotent triage comment with ready-to-run approval/merge commands.
  • Maintainer Batch Triage & Squash-Merge CLI (scripts/pr-automation.mjs, npm run pr:triage, npm run pr:merge):
    • npm run pr:triage runs a read-only audit of all open Dependabot PRs.
    • npm run pr:merge verifies signatures, provenance, policy, mergeability, and all required checks, then approves as CODEOWNER and squash-merges eligible green PRs (with optional --local-test, --rebase-conflicts, and --allow-npm-dev-major).
  • Dependabot Config (.github/dependabot.yml) & Provisioner (scripts/configure-github.sh):
    • Groups npm minor/patch updates while isolating major npm updates, keeps codeql-action grouped, raises github-actions PR limit to 10, and provisions npm, automerge-eligible, and manual-review-required labels.
  • Zero-Mock Vitest Suite (tests/workflow-and-pr-automation.test.ts):

Verification & Bridge Crew Gate

  • npm run typecheck passes with zero errors (src/ + tests/).
  • npm run build succeeds cleanly.
  • npm test passes 100% of unit, integration, adversarial, and E2E suites (10/10 test files, 35/35 tests).
  • npm audit --audit-level=high reports 0 vulnerabilities.
  • npm run verify:workflows and node scripts/verify-workflows.mjs --verify-remote-tags pass (6/6 workflows, 17/17 upstream tag-to-SHA pins verified).
  • Bridge Crew self-audit (EngineeringOfficer, SecurityOfficer, BridgeOfficer) maintains 100/100 KPI scores without regressions.
  • Every added or updated GitHub Action is pinned to an immutable 40-character commit SHA with explicit minimal permissions:.
  • Documentation (README.md, CONTRIBUTING.md) updated.

… maintainer merge CLI

Adds automated workflow & supply-chain verification (SHA pinning, explicit permissions, pull_request_target safety, multi-subaction lockstep for github/codeql-action/*, Dependabot group guard, GitHub Pages bundle check, and upstream tag-to-SHA provenance) plus Dependabot PR triage and local CODEOWNER batch squash-merge automation.

- Runs workflow integrity checks in required CI verify job.
- Adds least-privilege dependabot-triage.yml workflow (leaves final CODEOWNERS approval manual).
- Implements policy: github-actions (patch/minor/major/grouped) and npm (patch/minor) eligible; npm major held for manual review.
- Adds npm run verify:workflows, npm run pr:triage, and npm run pr:merge.
- Adds zero-mock Vitest suite including live 100/100 Bridge Crew officer self-audit.
@onimurasame
onimurasame merged commit 0f8a8b7 into master Nov 25, 2026
4 checks passed
@onimurasame
onimurasame deleted the ci/dependabot-pr-automation branch November 25, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant