feat(template): add task setup:github for idempotent repo settings#86
Merged
Conversation
The post-generation GitHub settings were all manual. Add a setup:github task that applies the fully idempotent, no-credential ones via gh (safe to re-run): - enable Dependabot alerts (PUT vulnerability-alerts) - enable private vulnerability reporting (PUT private-vulnerability-reporting) - set the FULL_SECURITY_SCAN variable (CodeQL) - (org repos only) add the <user>-bot account as a Write collaborator REPO is baked from [[ github_org ]]/[[ project_slug ]]; the collaborator step is jinja-gated to org repos (github_org != author_git_provider_username), mirroring the CHECKLIST. Steps that need a browser (Renovate/CodeRabbit app installs, GHCR policy, CI App creation) or a real credential (Actions secrets, Project V2) deliberately stay manual — wrapping those would just script a credential prompt. CHECKLIST §2 now leads with `task setup:github` and drops the three folded bullets (Advanced Security, FULL_SECURITY_SCAN, bot collaborator); the ruleset import stays manual (its POST isn't idempotent) with an added ordering note. Verified: task test:template:all passes; org and personal renders produce the correct conditional cmds/desc and parse via `task --list-all`; rendered CHECKLIST has no leaked jinja markers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
The post-generation GitHub setup (CHECKLIST §2) was entirely manual. This adds a
task setup:githubtarget to the generated Taskfile that applies thefully idempotent, no-credential settings via
gh— safe to re-run:PUT repos/$R/vulnerability-alerts)PUT .../private-vulnerability-reporting)FULL_SECURITY_SCANvariable (CodeQL)<user>-botaccount as a Write collaboratorThe collaborator step is jinja-gated to org repos (mirroring the CHECKLIST's
existing
github_org != author_git_provider_usernamegate), so a personal repo'srendered task omits it.
Deliberately left manual
Anything needing a browser OAuth consent (Renovate / CodeRabbit app installs,
GHCR publishing policy, CI GitHub App creation) or a real credential
(
CLAUDE_CODE_OAUTH_TOKEN,SNYK_TOKEN,CI_APP_*, Project V2). The branchruleset import also stays manual — its
POST /rulesetsisn't idempotent (a guardkeyed on the ruleset name would be needed); I added an ordering note instead.
CHECKLIST §2 now leads with
task setup:githuband drops the three folded bullets(Advanced Security,
FULL_SECURITY_SCAN, bot collaborator).Test plan
task test:template:allpasses (all 5 profiles). ✅github_org=someorg):REPO=someorg/..., collaborator line + "botcollaborator" in the desc present;
task --list-allparses it. ✅"bot collaborator". ✅
docs/CHECKLIST.md§2 reads correctly with no leaked jinja markers. ✅Context
Third in the series surfaced while applying the template to
sommerlawn-infra(after #84 markdownlint fixes and harmon-devkit#22). Scope was confirmed with the
maintainer: only the four fully-idempotent operations, nothing requiring guards,
credentials, or a browser.
🤖 Generated with Claude Code