Skip to content

[Phase 1] Create petry-projects/repo-template as a flagged template repository #965

Closed

Description

@github-actions

Story

As a org admin,
I want create an empty petry-projects/repo-template repository and flag it as a GitHub template repository with the standard general settings applied,
so that new repos can be scaffolded with one "Use this template" click instead of a manual copy-from-standards runbook.

Acceptance Criteria

  1. petry-projects/repo-template exists and gh repo view petry-projects/repo-template --json isTemplate returns isTemplate: true.
  2. The repo has a default main branch and the standard general settings applied (squash-only merge with merge/rebase disabled, delete-branch-on-merge, auto-merge enabled) — because a template click copies files only, not settings.
  3. The repo is empty of product scaffold content (the verbatim scaffold lands in the Phase 1 scaffold story); only an initial commit / placeholder README is present.
  4. Repo creation and the is_template flag are set with an org-admin classic PAT (not the Actions GITHUB_TOKEN), and the who/when of the action is recorded for auditability.
  5. No activation label (e.g. initiative:auto) is applied to the repo or this work.

Tasks / Subtasks

Dev Notes

  • Hands-off: creating an org repo and setting is_template requires org-admin and a classic PAT; the Actions GITHUB_TOKEN / dev-lead cannot create org repos or change security_and_analysis. scripts/apply-repo-settings.sh documents that a classic PAT with repo scope is required and OAuth app tokens are rejected by the check-suites API.
  • GitHub template repos copy files + (optionally) branches with UNRELATED history only — they do NOT carry settings, branch protection, rulesets, required checks, labels, secrets, or security config. That non-file gap is closed by the Phase 2 bootstrap, not here.
  • Pick the org default visibility and note it; do not apply initiative:auto or any activation label (apply-plan.sh enforces this for issues, and the same inert-by-default discipline applies to the new repo).

Project Structure Notes

This story operates on a new external repo, not on files in .github-private. Settings are applied by reusing the existing scripts/apply-repo-settings.sh against the new target.

References

Likely target surface

  • scripts/apply-repo-settings.sh

Story prepared by the BMAD Scrum Master (Bob) for epic #964. Status: ready-for-dev.

Activity

  1. added
    initiativeEpic / initiative tracking issue
    initiative:holdInitiative driver must not release this issue (human hold)
    dev-lead:hands-offExclude from dev-lead agent automation
    on Jun 27, 2026
  2. don-petry commented on Jun 28, 2026

    @don-petry
    Collaborator

    ✅ Template repo created (AC #4 audit record)

    Repo: https://github.com/petry-projects/repo-template
    Operator: don-petry (org-admin)
    Token: gh CLI token, scopes admin:org, repo (OAuth gho_, not a classic PAT)
    When: 2026-06-28T01:41:12Z

    Acceptance criteria

    • AC#1 — repo exists, isTemplate=true. ✅
    • AC#2 — default branch main; general settings applied: squash-only (merge & rebase disabled), delete-branch-on-merge, auto-merge enabled. ✅ (set via PATCH /repos/{owner}/{repo})
    • AC#3 — empty of product scaffold; only a placeholder README.md from the initial commit. ✅ (verbatim scaffold lands in [Phase 1] Seed the verbatim file scaffold into repo-template #966)
    • AC#4 — recorded above. ✅
    • AC#5 — no initiative:auto/activation label applied to the repo or this work. ✅
    • Visibility: public (org default — every existing petry-projects repo is public).

    ⚠️ Follow-up (not in #965's AC, flagged for honesty)

    scripts/apply-repo-settings.sh could not apply the check-suite auto-trigger prefs (disable Claude/CodeRabbit auto-trigger): the check-suites API rejects the OAuth token (could not read check-suite preferences). This needs an org-admin classic PAT with repo scope. Re-run GH_TOKEN=<classic-PAT> bash scripts/apply-repo-settings.sh petry-projects/repo-template when one is available. For repos created from the template this is covered by the Phase 2 bootstrap (#967, merged).

    Closing as done — this unblocks #966 (seed scaffold) → #969 → #970.

  3. don-petry commented on Jun 28, 2026

    @don-petry
    Collaborator

    ✅ Check-suite follow-up completed (2026-06-28T02:11:27Z)

    Applied with an org-admin classic PAT (ghp_, provided out-of-band and shredded immediately after use — never written to disk in-repo or printed).

    Disabled auto-trigger on petry-projects/repo-template for the apps that queue check suites they never complete (the auto-merge blockers):

    • Claude (app 1236702) → setting=false ✓
    • CodeRabbit (app 347564) → setting=false ✓
    • SonarQubeCloud (12526) and Cursor (1210556) left enabled (they complete their suites).

    Verified via the API read-back of PATCH /repos/petry-projects/repo-template/check-suites/preferences.

    Minor note / latent bug: scripts/apply-repo-settings.sh could not apply this via its normal path even with a valid classic PAT — its check-suite read precheck emits could not read check-suite preferences and bails before writing. I applied the write directly via gh api. Worth a follow-up issue to fix the script's precheck so the standard path works. The general settings and is_template from the earlier comment remain in place; repo-template's day-0 compliance for the check-suite dimension is now satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-lead:hands-offExclude from dev-lead agent automationinitiativeEpic / initiative tracking issueinitiative:holdInitiative driver must not release this issue (human hold)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions