Complete configuration guide for GitHub Workflow Blueprint
This guide covers all required settings to make the blueprint workflows function correctly.
Location: Repository Settings → Secrets and variables → Actions
Purpose: Enables Claude Code Action for AI-powered code reviews
How to get it:
How to set it:
# Via gh CLI
gh secret set ANTHROPIC_API_KEY
# Via GitHub UI
Settings → Secrets and variables → Actions → New repository secret
Name: ANTHROPIC_API_KEY
Secret: <your-api-key>
Required by:
Purpose: Enables GitHub Projects v2 integration and Wiki sync
How to create it:
PROJECTS_TOKEN or GitHub Workflow Automationrepo (Full control of private repositories)project (Full control of projects)write:discussion (Read and write team discussions)How to set it:
# Via gh CLI
gh secret set PROJECTS_TOKEN
# Via GitHub UI
Settings → Secrets and variables → Actions → New repository secret
Name: PROJECTS_TOKEN
Secret: <your-token>
Required by:
project-sync composite actionPurpose: Alternative to ANTHROPIC_API_KEY for Claude Code Review
How to get it:
How to set it:
gh secret set CLAUDE_CODE_OAUTH_TOKEN
Note: Only needed if using OAuth flow instead of API key. The workflow will skip Claude Code Review if neither secret is set.
Location: Repository Settings → Branches → Branch protection rules
Branch name pattern: main
Required Settings:
Validate Source BranchProduction BuildSmoke TestsDeployment ReadinessRelease Gate Status✅ Require conversation resolution before merging
✅ Require linear history (enforces squash or rebase merges)
CLI Command:
gh api repos/{owner}/{repo}/branches/main/protection \
--method PUT \
--field required_status_checks='{"strict":true,"checks":[{"context":"Validate Source Branch"},{"context":"Production Build"},{"context":"Smoke Tests"},{"context":"Deployment Readiness"},{"context":"Release Gate Status"}]}' \
--field enforce_admins=true \
--field required_pull_request_reviews='{"required_approving_review_count":1,"dismiss_stale_reviews":true}' \
--field restrictions=null \
--field required_linear_history=true \
--field allow_force_pushes=false \
--field allow_deletions=false \
--field required_conversation_resolution=true
Branch name pattern: dev
Required Settings:
Validate Branch NameValidate PR TitleValidate Linked IssueRun Quality Checks✅ Require conversation resolution before merging
CLI Command:
gh api repos/{owner}/{repo}/branches/dev/protection \
--method PUT \
--field required_status_checks='{"strict":true,"checks":[{"context":"Validate Branch Name"},{"context":"Validate PR Title"},{"context":"Validate Linked Issue"},{"context":"Run Quality Checks"}]}' \
--field enforce_admins=false \
--field required_pull_request_reviews='{"required_approving_review_count":0,"dismiss_stale_reviews":true}' \
--field restrictions=null \
--field allow_force_pushes=false \
--field allow_deletions=false \
--field required_conversation_resolution=true
Location: Repository → Projects tab → Link a project
Option 1: Via GitHub UI
Development Workflow (or your choice)Option 2: Via gh CLI
# Create new project
gh project create --owner <username> --title "Development Workflow"
# Link to repository
gh project link <project-number> --repo <username>/<repo>
Required Status Values (in this exact order):
| Status | Purpose |
|---|---|
| To Triage | New issues pending review |
| Backlog | Approved but not scheduled |
| Ready | Ready to start work |
| In Progress | Actively being worked on |
| In Review | PR created, awaiting review |
| To Deploy | Merged to dev, ready for release |
| Done | Released to production |
How to configure:
Important: The workflow expects these exact names. If you use different names, update the project-sync composite action.
You need the project URL for the PROJECT_URL secret:
# Via gh CLI
gh project list --owner <username>
# The URL will be like:
# https://github.com/users/<username>/projects/<number>
Save this URL - you’ll need it for the bootstrap workflow.
Location: Repository Settings → General
Location: Repository Settings → Actions → General
Required Configuration:
Workflow permissions:
Fork pull request workflows:
Location: Repository → Issues → Labels
Run the bootstrap.yml workflow to automatically create these, or create manually:
status:ready - 🟢 Green - Ready to startstatus:in-progress - 🟡 Yellow - Work in progressstatus:in-review - 🟠 Orange - In code reviewstatus:to-deploy - 🔵 Blue - Ready for deploymenttype:feature - 🟣 Purple - New featuretype:fix - 🔴 Red - Bug fixtype:hotfix - 🔥 Dark red - Critical hotfixtype:docs - 📘 Light blue - Documentationtype:refactor - 🔧 Grey - Code refactoringtype:test - ✅ Green - Testingplatform:web - 🌐 Blue - Web platformplatform:mobile - 📱 Purple - Mobile platformplatform:fullstack - 🔗 Orange - Full-stackpriority:critical - 🔴 Red - Critical prioritypriority:high - 🟠 Orange - High prioritypriority:medium - 🟡 Yellow - Medium prioritypriority:low - 🟢 Green - Low priorityclaude-code - 🤖 Purple - Created by Claude CodeAuto-create labels:
# Run bootstrap workflow
gh workflow run bootstrap.yml
# Or create via CLI
gh label create "status:ready" --color "0E8A16" --description "Ready to start"
gh label create "type:feature" --color "A855F7" --description "New feature"
# ... repeat for all labels
Location: Repository Settings → Pages
Configuration:
Deployment:
deploy-pages.yml workflowhttps://<username>.github.io/<repo>/Location: Repository Settings → Code security and analysis
Enable:
.github/dependabot.yml)Pre-configured in this blueprint:
Location: Repository Settings → Environments
Recommended Environments:
mainAfter completing setup, verify everything works:
# Check secrets are set (will show names only, not values)
gh secret list
Expected output:
ANTHROPIC_API_KEY Updated 2025-XX-XX
PROJECTS_TOKEN Updated 2025-XX-XX
# Run initial setup
gh workflow run bootstrap.yml
# Check status
gh run list --workflow=bootstrap.yml --limit 1
Expected: Creates labels, validates project board, checks secrets
# Try to push directly to main (should fail)
git checkout main
echo "test" >> test.txt
git add test.txt
git commit -m "test: direct commit"
git push origin main
# Expected: rejected by remote
# Create test issue
gh issue create --title "Test: Validate setup" --body "Testing workflow automation"
# Expected: Issue created, added to project board in "To Triage" status
# Create feature branch
git checkout -b feature/test-setup
echo "# Test" > TEST.md
git add TEST.md
git commit -m "feat: test workflow"
git push -u origin feature/test-setup
# Create PR to dev
gh pr create --base dev --title "feat: Test workflow" --body "Closes #<issue-number>"
# Expected:
# - Branch name validation passes
# - PR title validation passes
# - Linked issue validation passes
# - Quality checks run
# Merge feature to dev
gh pr merge <pr-number> --squash
# Create release PR
gh pr create --base main --head dev --title "release: v1.0.0" --body "Release notes..."
# Expected:
# - Source branch validation passes (dev allowed)
# - All release gates run
# - Project board updates
Solution:
gh secret listrepo and project scopesgh secret set PROJECTS_TOKENSolution:
project scopegh project list --owner <username> to verify accessSolution:
Solution:
Solution:
# Run bootstrap workflow
gh workflow run bootstrap.yml
# Or create manually via CLI/UI
For advanced users, here’s a script to automate most settings:
#!/bin/bash
# setup-github.sh - Automated GitHub setup
set -e
REPO="${1:-$(gh repo view --json nameWithOwner -q .nameWithOwner)}"
PROJECT_URL="${2:-}"
echo "🔧 Setting up GitHub repository: $REPO"
# 1. Enable required features
echo "📝 Enabling repository features..."
gh api repos/$REPO -X PATCH \
--field has_issues=true \
--field has_wiki=true \
--field has_projects=true \
--field allow_squash_merge=true \
--field delete_branch_on_merge=true
# 2. Set workflow permissions
echo "🔐 Configuring Actions permissions..."
gh api repos/$REPO/actions/permissions -X PUT \
--field enabled=true \
--field allowed_actions="all"
gh api repos/$REPO/actions/permissions/workflow -X PUT \
--field default_workflow_permissions="write" \
--field can_approve_pull_request_reviews=true
# 3. Run bootstrap workflow
echo "🚀 Running bootstrap workflow..."
gh workflow run bootstrap.yml -R $REPO
echo "✅ Setup complete!"
echo ""
echo "⚠️ Manual steps remaining:"
echo "1. Set ANTHROPIC_API_KEY secret"
echo "2. Set PROJECTS_TOKEN secret"
echo "3. Configure branch protection rules"
echo "4. Link project board (if not already linked)"
echo ""
echo "Run: ./setup/validate.sh to verify setup"
Last Updated: 2025-11-07 Version: 1.0.0 Status: Production Ready