Apply the "GitHub Actions and Renovate Guide" to configure repo settings, branch protection, GitHub App/PAT secrets, renovate.json5, and optional CI auto-fix workflow for personal or team GitHub...
Required:
gh auth loginrepo, admin:org (for org repos), workflowQuick verification:
# Check admin access and required scopes
gh auth status
gh api repos/$OWNER/$REPO | jq -e '.permissions.admin == true' || echo "Need admin access"
If setup fails: See references/GH_CLI_SETUP.md for detailed authentication troubleshooting and permission requirements.
1. Check existing setup:
ls -la renovate.json* .github/renovate.json* .renovaterc* 2>/dev/null
gh pr list --author "renovate[bot]" --limit 5
2. Identify project type:
3. Collect inputs:
4. Follow workflow steps below
If your repository is public with a single maintainer, you can use a much simpler setup:
What you can skip:
Minimal setup steps:
.github/renovate.json5 or renovate.json to your repositoryIMPORTANT: Support Fork PRs
If accepting contributions from forks, add fork-aware conditions to workflows:
jobs:
# Jobs that need secrets (should NOT run on fork PRs)
auto-merge:
if: |
github.event_name != 'pull_request' ||
! github.event.pull_request.head.repo.fork
steps:
# Uses secrets - safe from fork access
# Jobs that don't need secrets (SHOULD run on fork PRs)
tests:
# No condition - runs on all PRs including forks
steps:
# No secrets used - safe for forks
Why this matters:
See references/guide.md "Fork PR conditions" section for complete patterns.
See references/guide.md "Public repository (single maintainer)" section for complete details.
Copy this checklist and track your progress:
Renovate Setup Progress:
- [ ] Prerequisites: gh CLI authenticated, admin access verified
- [ ] Step 1: Repository settings + status-check job + branch protection
- [ ] Step 2: GitHub App setup + secrets (or use hosted app)
- [ ] Step 3: Add renovate.json5 (choose preset)
- [ ] Step 4: (Optional) Self-hosted workflow
- [ ] Step 5: Validation + test PR
Required permissions:
repo (full control)Verify before proceeding:
# Must return true
gh api repos/$OWNER/$REPO | jq '.permissions.admin'
CRITICAL: Implement status-check job pattern first
Before configuring branch protection, you MUST add a status-check job to your CI workflows:
Why it's required:
Implementation options:
Option A: Unified workflow (recommended for new projects)
assets/workflows/ci-unified-example.yml as templatedorny/paths-filter for conditional executionstatus-check job depends on all checksOption B: Add status-check to existing workflows (easier migration)
references/BRANCH_PROTECTION.md "Migration Strategy"See complete implementation guide:
references/BRANCH_PROTECTION.md for detailed examples and patternsassets/workflows/ci-unified-example.yml for working exampleRepository settings:
# Enable auto-merge (requires admin access)
gh api -X PATCH repos/$OWNER/$REPO -f allow_auto_merge=true
# If error 403: Need repository admin access
# If error 404: Repository not found or no access
Branch protection for default branch:
After implementing status-check job:
# Personal project (basic)
# Requires: admin access, repo scope
gh api -X PUT repos/$OWNER/$REPO/branches/$BRANCH/protection \
--input - <<EOF
{
"required_status_checks": {
"strict": true,
"contexts": ["status-check"]
},
"enforce_admins": true,
"required_pull_request_reviews": {
"required_approving_review_count": 0
},
"restrictions": null,
"allow_force_pushes": false,
"allow_deletions": false
}
EOF
For team projects with reviews, see references/BRANCH_PROTECTION.md.
For team projects only:
Add dedicated branch protection for renovate/* branches:
# Requires: admin access, repo scope
gh api -X PUT repos/$OWNER/$REPO/branches/renovate%2F*/protection \
--input - <<EOF
{
"required_status_checks": null,
"enforce_admins": false,
"required_pull_request_reviews": null,
"restrictions": {
"users": [],
"teams": [],
"apps": ["renovate"]
},
"allow_force_pushes": {"enabled": true},
"allow_deletions": {"enabled": true}
}
EOF
Validation:
# Verify auto-merge is enabled
gh api repos/$OWNER/$REPO | jq '.allow_auto_merge'
# Check branch protection
gh api repos/$OWNER/$REPO/branches/$BRANCH/protection | jq '{required_status_checks, enforce_admins}'
# Verify status-check is the required check
gh api repos/$OWNER/$REPO/branches/$BRANCH/protection | jq '.required_status_checks.contexts'
# Expected: ["status-check"]
Choose authentication method:
Hosted Renovate App (simplest):
Self-hosted with GitHub App (full control):
Quick setup: a. Create app: https://github.com/settings/apps/new
renovate-bot-<username> (globally unique)contents: write, pull-requests: write, workflows: write (optional)b. Generate private key → Download .pem file
c. Install app to repositories
d. Store secrets:
# Personal project
gh secret set RENOVATE_APP_ID --body "<app-id>"
gh secret set RENOVATE_APP_PRIVATE_KEY < private-key.pem
# Team project (environment) - protects secrets with branch policy
gh api -X PUT repos/$OWNER/$REPO/environments/renovate --input - <<EOF
{"deployment_branch_policy": {"protected_branches": false, "custom_branch_policies": true}}
EOF
gh secret set RENOVATE_APP_ID --env renovate --body "<app-id>"
gh secret set RENOVATE_APP_PRIVATE_KEY --env renovate < private-key.pem
e. Configure bot username in renovate.json5:
{ username: "renovate-bot-<your-username>[bot]" }
Find exact username after first run:
gh pr list --author "renovate" --json author --jq '.[0].author.login'
Detailed guide: See references/GITHUB_APP_SETUP.md for troubleshooting, permission details, and alternative setups.
Check for existing configuration first:
# Check for existing Renovate config
if [ -f renovate.json ] || [ -f .github/renovate.json5 ] || [ -f .renovaterc ]; then
echo "Renovate config already exists. Validating..."
# Skip to validation step
else
echo "No Renovate config found. Creating new configuration..."
fi
If configuration already exists, validate it with Step 5 and skip the rest of this step.
Choose configuration preset:
assets/renovate.json5 - Minimal (extends external config)assets/renovate-conservative.json5 - Conservative updates (stable dependencies)assets/renovate-aggressive.json5 - Aggressive updates (latest versions quickly)Place config file:
# Copy chosen preset to your repository
cp assets/renovate-conservative.json5 .github/renovate.json5
Customize as needed:
Validation:
# Validate JSON5 syntax
npx -p renovate renovate-config-validator .github/renovate.json5
When to use:
Setup:
# Copy workflow template
mkdir -p .github/workflows
cp assets/workflows/renovate.yml .github/workflows/renovate.yml
Configure workflow:
repositories parameter if managing multiple reposSee references/renovate-action.md for action inputs and GitHub App token usage.
Validation:
# Check workflow syntax
actionlint .github/workflows/renovate.yml
# Trigger manual run to test
gh workflow run renovate.yml
Check Renovate config:
npx -p renovate renovate-config-validator .github/renovate.json5
Verify GitHub settings:
# Repository settings
gh api repos/$OWNER/$REPO | jq '{allow_auto_merge, default_branch}'
# Branch protection
gh api repos/$OWNER/$REPO/branches/$BRANCH/protection | jq '{required_status_checks, required_pull_request_reviews}'
# Secrets are configured
gh api repos/$OWNER/$REPO/actions/secrets | jq '.secrets[].name'
Test with dry-run (if self-hosting):
# Add --dry-run to workflow for testing
# Or run locally:
npx renovate --dry-run --token=$GITHUB_TOKEN $OWNER/$REPO
github-actions manager, ensure the token has workflow permissions.assets/renovate.json5: starter Renovate config (minimal).assets/renovate-conservative.json5: conservative update strategy preset.assets/renovate-aggressive.json5: aggressive update strategy preset.assets/workflows/renovate.yml: Renovate GitHub Actions workflow template (self-hosting only).assets/workflows/ci-unified-example.yml: unified CI workflow with status-check job pattern.references/guide.md: summarized settings from the guide (personal vs team).references/renovate-action.md: Renovate GitHub Action usage details.references/VALIDATION.md: validation commands and troubleshooting guide.references/BRANCH_PROTECTION.md: status-check job pattern and branch protection configuration.references/GITHUB_APP_SETUP.md: complete GitHub App creation and configuration guide.references/GH_CLI_SETUP.md: GitHub CLI authentication, required scopes, and permission requirements.