Repository settings
Settings the pipeline needs that live outside the workflow files, and which of them Terraform manages.
GitHub Environments, their reviewers and variables, and branch rules are repository settings, not files in .github/. A workflow that names an Environment that does not exist creates an empty one with no protection rules, so these settings must exist before the first run.
Managed by infrastructure/github
- Environments
dev,staging,prodexist, with names that matchgithub_environmentin each account’s bootstrap - Each Environment: deployment branches limited to
main(custom policy, patternmain) -
prod: at least one required reviewer (the variable validation refuses an empty list);prevent_self_review = false; admins cannot bypass -
dev,staging: no reviewers, so that merges deploy automatically - Environment variables in each Environment:
AWS_DEPLOY_ROLE_ARN,AWS_TERRAFORM_APPLY_ROLE_ARN,ECR_REPOSITORY_URL,ECS_CLUSTER,ECS_SERVICE,TASK_FAMILY,SITE_BUCKET,DISTRIBUTION_ID,PUBLIC_URL,FREEZE_PARAMETER - Repository variables:
AWS_REGION, plusTF_PLAN_ROLE_ARN_*,TF_STATE_BUCKET_*andTF_STATE_KMS_KEY_ARN_*forDEV,STAGINGandPROD - Ruleset on
main: pull request required, stale approvals dismissed, no force push, no deletion - Ruleset on
main: required checkci-okfrom the GitHub Actions app only, branch up to date before merge
Set by hand
-
SLACK_WEBHOOK_URLas an Environment secret (optional):gh secret set SLACK_WEBHOOK_URL --env <env> - OpenAI key in each account’s Secrets Manager secret (
openai_secret_arn); the smoke test needs it - Actions enabled, and “Allow GitHub Actions to create and approve pull requests” left off
- Workflow permissions default set to read-only; the workflows ask for more per job
- A plan that supports required reviewers for this repository: public, or GitHub Enterprise when private
Already in the workflows
-
permissions: {}at the top of every workflow - No
pull_request_target -
persist-credentials: falseon every checkout - Actions pinned to commit SHAs, and tool images pinned by digest
- No AWS keys anywhere; OIDC only