Phase 1: Org-wide PR template, label taxonomy, and reusable workflows#2
Merged
Conversation
This populates trufflesecurity/.github with shared building blocks that
consumer repos in the org will call:
* `.github/PULL_REQUEST_TEMPLATE.md` — default PR template inherited by
any repo without its own
* `labels.yml` — single source of truth for the 11-label taxonomy
(size/risk/review/status/complexity)
* `.github/workflows/pr-labeler-reusable.yml` — applies size/risk/checkbox
labels to PRs (size from additions+deletions, risk parsed from Bugbot's
CURSOR_SUMMARY block, three-state checkbox labels from the template)
* `.github/workflows/label-sync-reusable.yml` — additively syncs labels.yml
into a caller repo via `gh label create --force`
* `.github/workflows/stale-reusable.yml` — wraps actions/stale@v9 with the
org's PR hygiene policy (14d stale, 16d close, exempts review/urgent and
drafts, throttled to 30 ops/run)
* `.github/scripts/{pr_labeler,label_sync}.py` — labeler/sync logic
* `.github/scripts/test_pr_labeler.py` — 35 unit tests for labeler logic
* `.github/workflows/test-scripts.yml` — runs unit tests on PRs and pushes
* `.github/workflows/lint.yml` — ruff (Python) + actionlint (workflow YAML)
* `README.md` — documents what lives here, the perms model, and how to
add a label
No reusable workflow declares its own `permissions:` block — they inherit
from callers, so each consumer must grant the minimum needed (documented
in the README).
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 of a cross-repo PR labeling and hygiene rollout. Populates this repo with shared building blocks that consumer repos in the org will call.
What this PR adds:
.github/PULL_REQUEST_TEMPLATE.mdlabels.ymlsize/*,risk/*,review/urgent,status/stale,complexity/high).github/workflows/pr-labeler-reusable.yml.github/workflows/label-sync-reusable.ymllabels.ymlinto a caller repo.github/workflows/stale-reusable.ymlactions/stale@v9(14d stale, 16d close, exemptsreview/urgentand drafts).github/workflows/lint.yml.github/workflows/test-scripts.yml.github/scripts/pr_labeler.py.github/scripts/label_sync.py.github/scripts/test_pr_labeler.pyREADME.mdPermissions model: No reusable workflow declares its own `permissions:` block — they inherit from callers. Each consumer caller declares the minimum its reusable needs (documented in README).
Versioning: Caller workflows reference these reusables at `@main`. Pushes to this branch immediately affect every consumer once they merge their callers in subsequent phases. Branch protection on `main` requires PR review.
Required follow-up after merge (manual UI step)
Set org default labels: `Organization settings > Repository defaults > Repository labels` → replace GitHub's defaults with the 11 labels from `labels.yml` so brand-new repos get them on day one. Existing repos are populated by the sync workflow in subsequent phases.
(No "enable Actions access" step is needed — this repo is public, so its reusable workflows are callable from anywhere by default.)
Test plan
Made with Cursor
Note
Medium Risk
Medium risk because it introduces reusable GitHub Actions and automation that can modify labels and stale/close PRs across consumer repos once adopted.
Overview
Adds org-wide GitHub tooling in this
.githubrepo: a defaultPULL_REQUEST_TEMPLATE.md, a canonicallabels.yml, and reusable workflows for label syncing, PR auto-labeling, and PR staleness handling.Implements Python scripts to (1) sync labels into a target repo via
gh label create --force(additive) and (2) compute/apply PRsize/*,risk/*(from<!-- CURSOR_SUMMARY -->), and author-declaredreview/urgent/complexity/highlabels from template checkboxes, with unit tests plus CI linting (ruff,actionlint) and script test coverage.Reviewed by Cursor Bugbot for commit e55e76b. Bugbot is set up for automated code reviews on this repo. Configure here.