// |
| name | github-project-automation |
| description | Automate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error |
| license | MIT |
| metadata | {"version":"1.0.0","last_verified":"2025-11-06T00:00:00.000Z","errors_prevented":18,"token_savings":"70%","complexity":"8/10"} |
Status: Production Ready โ Last Updated: 2025-11-06 Dependencies: None (git and gh CLI recommended) Latest Versions: actions/checkout@v4.2.2, actions/setup-node@v4.1.0, github/codeql-action@v3.27.4
Select the workflow template that matches your project:
# For React/Vite projects
cp templates/workflows/ci-react.yml .github/workflows/ci.yml
# For Node.js libraries (matrix testing)
cp templates/workflows/ci-node.yml .github/workflows/ci.yml
# For Python projects
cp templates/workflows/ci-python.yml .github/workflows/ci.yml
# For Cloudflare Workers
cp templates/workflows/ci-cloudflare-workers.yml .github/workflows/deploy.yml
# For basic projects (any framework)
cp templates/workflows/ci-basic.yml .github/workflows/ci.yml
Why this matters:
# Create directory structure
mkdir -p .github/ISSUE_TEMPLATE
# Copy YAML templates (with validation)
cp templates/issue-templates/bug_report.yml .github/ISSUE_TEMPLATE/
cp templates/issue-templates/feature_request.yml .github/ISSUE_TEMPLATE/
Why YAML over Markdown:
# CodeQL for code analysis
cp templates/workflows/security-codeql.yml .github/workflows/codeql.yml
# Dependabot for dependency updates
cp templates/security/dependabot.yml .github/dependabot.yml
CRITICAL:
Create the standard GitHub automation directory structure:
# Create all required directories
mkdir -p .github/{workflows,ISSUE_TEMPLATE}
# Verify structure
tree .github/
# .github/
# โโโ workflows/ # GitHub Actions workflows
# โโโ ISSUE_TEMPLATE/ # Issue templates
# โโโ dependabot.yml # Dependabot config (root of .github/)
Key Points:
Choose workflows based on your project needs:
Continuous Integration (pick ONE):
ci-basic.yml - Generic test/lint/build (all frameworks)ci-node.yml - Node.js with matrix testing (18, 20, 22)ci-python.yml - Python with matrix testing (3.10, 3.11, 3.12)ci-react.yml - React/TypeScript with type checkingDeployment (optional):
5. ci-cloudflare-workers.yml - Deploy to Cloudflare Workers
Security (recommended):
6. security-codeql.yml - Code scanning
7. dependabot.yml - Dependency updates
Copy selected templates:
# Example: React app with security
cp templates/workflows/ci-react.yml .github/workflows/ci.yml
cp templates/workflows/security-codeql.yml .github/workflows/codeql.yml
cp templates/security/dependabot.yml .github/dependabot.yml
For deployment workflows (Cloudflare, AWS, etc.), add secrets:
# Using gh CLI
gh secret set CLOUDFLARE_API_TOKEN
# Paste your token when prompted
# Verify
gh secret list
Critical Syntax:
# โ
CORRECT
env:
API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# โ WRONG - Missing double braces
env:
API_TOKEN: $secrets.CLOUDFLARE_API_TOKEN
Prevents Error #6 (secrets syntax).
Issue templates (YAML format):
cp templates/issue-templates/bug_report.yml .github/ISSUE_TEMPLATE/
cp templates/issue-templates/feature_request.yml .github/ISSUE_TEMPLATE/
PR template (Markdown format):
cp templates/pr-templates/PULL_REQUEST_TEMPLATE.md .github/
Why separate formats:
Required customizations:
Update usernames/emails:
# In issue templates
assignees:
- jezweb # โ Change to your GitHub username
# In dependabot.yml
reviewers:
- "jezweb" # โ Change to your username
Adjust languages (CodeQL):
# In security-codeql.yml
matrix:
language: ['javascript-typescript'] # โ Add your languages
# Options: c-cpp, csharp, go, java-kotlin, python, ruby, swift
Update package manager (Dependabot):
# In dependabot.yml
- package-ecosystem: "npm" # โ Change if using yarn/pnpm/pip/etc
Set deployment URL (Cloudflare):
# In ci-cloudflare-workers.yml
echo "Worker URL: https://your-worker.your-subdomain.workers.dev"
# โ Update with your actual Worker URL
โ Pin actions to SHA, not @latest
# โ
CORRECT
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# โ WRONG
- uses: actions/checkout@latest
โ Use explicit runner versions
# โ
CORRECT
runs-on: ubuntu-24.04 # Locked to specific LTS
# โ RISKY
runs-on: ubuntu-latest # Changes over time
โ Include secrets in context syntax
# โ
CORRECT
${{ secrets.API_TOKEN }}
# โ WRONG
$secrets.API_TOKEN
โ Validate YAML before committing
# Use yamllint or GitHub's workflow validator
yamllint .github/workflows/*.yml
โ Test workflows on feature branch first
git checkout -b test/github-actions
# Push and verify CI runs before merging to main
โ Don't use @latest for action versions
โ Don't hardcode secrets in workflows
# โ NEVER DO THIS
env:
API_TOKEN: "sk_live_abc123..." # Secret exposed in repo!
โ Don't skip build steps for compiled languages (CodeQL)
# โ WRONG - CodeQL fails for Java without build
- name: Perform CodeQL Analysis # No .class files to analyze
# โ
CORRECT - Include build
- name: Build project
run: ./mvnw clean install
- name: Perform CodeQL Analysis # Now has .class files
โ Don't ignore devDependencies in Dependabot
โ Don't use single ISSUE_TEMPLATE.md file
# โ OLD WAY
.github/ISSUE_TEMPLATE.md
# โ
NEW WAY
.github/ISSUE_TEMPLATE/
bug_report.yml
feature_request.yml
This skill prevents 18 documented issues:
Error: workflow file is invalid. mapping values are not allowed in this context
Source: Stack Overflow (most common GitHub Actions error)
Why It Happens: Spaces vs tabs, missing spaces after colons, inconsistent indentation
Prevention: Use skill templates with validated 2-space indentation
run or uses FieldError: Error: Step must have a run or uses key
Source: GitHub Actions Error Logs
Why It Happens: Empty step definition, forgetting to add command
Prevention: Templates include complete step definitions
Error: Workflow breaks unexpectedly after action updates
Source: GitHub Security Best Practices 2025
Why It Happens: Using @latest or @v4 instead of specific SHA
Prevention: All templates pin to SHA with version comment
Error: Unexpected environment changes, compatibility issues
Source: CI/CD Troubleshooting Guides
Why It Happens: ubuntu-latest changed from 22.04 โ 24.04 in 2024
Prevention: Templates use explicit ubuntu-24.04
Error: duplicate key found in mapping
Source: YAML Parser Updates
Why It Happens: Copy-paste errors, duplicate job/step names
Prevention: Templates use unique, descriptive naming
Error: Secret not found or empty variable
Source: GitHub Actions Debugging Guides
Why It Happens: Wrong syntax ($secrets.NAME instead of ${{ secrets.NAME }})
Prevention: Templates demonstrate correct context syntax
Error: Matrix doesn't expand, tests skipped Source: Troubleshooting Guides Why It Happens: Invalid matrix config, wrong variable reference Prevention: Templates include working matrix examples
Error: Variables not interpolated, empty values
Source: GitHub Actions Docs
Why It Happens: Forgetting ${{ }} wrapper
Prevention: Templates show all context patterns
Error: Contributors ignore template, incomplete issues Source: GitHub Best Practices Why It Happens: 20+ fields, asking irrelevant details Prevention: Skill templates are minimal (5-8 fields max)
Error: Vague bug reports, hard to reproduce Source: Template Best Practices Why It Happens: No guidance on what info is needed Prevention: Templates include specific placeholders
Error: Users don't know which template to use
Source: GitHub Docs
Why It Happens: Using single ISSUE_TEMPLATE.md file
Prevention: Proper ISSUE_TEMPLATE/ directory with config.yml
Error: Incomplete issues, missing critical info
Source: Community Feedback
Why It Happens: Markdown templates don't validate
Prevention: YAML templates with required: true
Error: Security scans skipped on dependency updates
Source: GitHub Community Discussion #121836
Why It Happens: Default trigger limitations
Prevention: Templates include push: branches: [dependabot/**]
Error: Legitimate PRs blocked, development stalled Source: Security Alerts Guide Why It Happens: Over-restrictive alert policies Prevention: Reference docs explain proper scoping
Error: No code found to analyze
Source: CodeQL Documentation
Why It Happens: Missing build steps for Java/C++/C#
Prevention: Templates include build examples
Error: Vulnerable devDependencies not scanned Source: Security Best Practices Why It Happens: Thinking devDependencies don't matter Prevention: Templates scan all dependencies
Error: Only 10 alerts auto-fixed, others queued Source: GitHub Docs (hard limit) Why It Happens: GitHub limits 10 open PRs per ecosystem Prevention: Templates document limit and workaround
Error: Wasted CI minutes, maintenance overhead Source: DevSecOps Guides Why It Happens: Separate workflows for CI/CodeQL/dependency review Prevention: Templates offer integrated option
See: references/common-errors.md for detailed error documentation with examples
version: 2
updates:
# npm dependencies (including devDependencies)
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Australia/Sydney"
open-pull-requests-limit: 10 # GitHub hard limit
reviewers:
- "jezweb"
labels:
- "dependencies"
- "npm"
commit-message:
prefix: "chore"
prefix-development: "chore"
include: "scope"
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
Why these settings:
name: CodeQL Security Scan
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
- cron: '0 0 * * 0' # Weekly on Sundays
jobs:
analyze:
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
security-events: write # REQUIRED for CodeQL
strategy:
fail-fast: false
matrix:
language: ['javascript-typescript'] # Add your languages
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Initialize CodeQL
uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f
with:
languages: ${{ matrix.language }}
# For compiled languages, add build here
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f
Critical permissions:
security-events: write is REQUIRED for CodeQL uploadsUse for libraries that support multiple Node.js/Python versions:
strategy:
matrix:
node-version: [18, 20, 22] # LTS versions
fail-fast: false # Test all versions even if one fails
steps:
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version: ${{ matrix.node-version }}
cache: 'npm' # Cache dependencies for speed
- run: npm ci # Use ci (not install) for reproducible builds
- run: npm test
When to use: Libraries, CLI tools, packages with broad version support
Deploy only on push to main (not PRs):
jobs:
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- run: npx wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
When to use: Production deployments, avoiding test deployments from PRs
Share build outputs between jobs:
jobs:
build:
steps:
- run: npm run build
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: build-output
path: dist/
retention-days: 7
deploy:
needs: build
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: build-output
path: dist/
- run: # Deploy from dist/
When to use: Separating build and deployment, sharing test results
Coming in Phase 3 - Automation scripts for common tasks:
setup-github-project.sh - Interactive setup wizardvalidate-workflows.sh - YAML validation before commitgenerate-codeowners.sh - Auto-generate from git logsync-templates.sh - Update existing projectsExample Usage:
./scripts/setup-github-project.sh react
# Prompts for project details, generates .github/ structure
Load when needed for detailed error resolution:
references/common-errors.md - All 18 errors with solutions (complete)references/github-actions-reference.md - Complete Actions API (Phase 2)references/workflow-syntax.md - YAML syntax guide (Phase 2)references/dependabot-guide.md - Dependabot deep-dive (Phase 2)references/codeql-guide.md - CodeQL configuration (Phase 2)references/secrets-management.md - Secrets best practices (Phase 2)references/matrix-strategies.md - Matrix patterns (Phase 2)When Claude should load these: When user encounters specific errors, needs deep configuration, or troubleshooting complex scenarios
Complete collection - 45+ files organized by type:
Workflows (12 templates):
Issue Templates (4 templates):
PR Templates (3 templates):
Security (3 templates):
Misc (2 templates):
When user creates new Worker project:
# User: "Create Cloudflare Worker with CI/CD"
# This skill runs AFTER cloudflare-worker-base
cp templates/workflows/ci-cloudflare-workers.yml .github/workflows/deploy.yml
# Configure secrets
gh secret set CLOUDFLARE_API_TOKEN
Result: New Worker with automated deployment on push to main
When user uses project-planning skill:
# User: "Plan new React app with GitHub automation"
# project-planning generates IMPLEMENTATION_PHASES.md
# Then this skill sets up GitHub automation
cp templates/workflows/ci-react.yml .github/workflows/ci.yml
cp templates/issue-templates/*.yml .github/ISSUE_TEMPLATE/
Result: Planned project with complete GitHub automation
When preparing project for open source:
# User: "Prepare repo for open source contributions"
# open-source-contributions skill handles CONTRIBUTING.md
# This skill adds issue templates and CODEOWNERS
cp templates/issue-templates/*.yml .github/ISSUE_TEMPLATE/
cp templates/misc/CODEOWNERS .github/
Result: Contributor-friendly repository
Status: Researched, not implemented (see /planning/github-projects-poc-findings.md)
Why separate skill: Complex GraphQL API, ID management, niche use case
When to consider: Team projects needing automated board management
Combining workflows for efficiency:
# Option A: Separate workflows (easier maintenance)
.github/workflows/
ci.yml # Test and build
codeql.yml # Security scanning
deploy.yml # Production deployment
# Option B: Integrated workflow (fewer CI minutes)
.github/workflows/
main.yml # All-in-one: test, scan, deploy
Trade-off: Separate = clearer, Integrated = faster (Error #18 prevention)
Deploy to staging and production:
jobs:
deploy-staging:
if: github.ref == 'refs/heads/develop'
steps:
- run: npx wrangler deploy --env staging
deploy-production:
if: github.ref == 'refs/heads/main'
steps:
- run: npx wrangler deploy --env production
Requires: Wrangler environments configured in wrangler.jsonc
Required:
Optional:
Install gh CLI:
# macOS
brew install gh
# Ubuntu
sudo apt install gh
# Verify
gh --version
Context7 Library ID: Search for /websites/github or /github/ in Context7 MCP
GitHub Actions (SHA-pinned in templates):
actions/checkout: 11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
actions/setup-node: 39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
actions/setup-python: 0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
actions/upload-artifact: b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
actions/download-artifact: fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
github/codeql-action/init: ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
github/codeql-action/analyze: ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
codecov/codecov-action: 5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.2
Verification Command:
# Check latest action versions
gh api repos/actions/checkout/releases/latest
gh api repos/github/codeql-action/releases/latest
This skill is based on production testing across 3 projects:
Project 1: React App
Project 2: Cloudflare Worker
Project 3: Python CLI Tool
Token Savings: ~70% (26,500 โ 7,000 tokens avg)
Symptoms: Pushed code but CI doesn't run
Solutions:
.github/workflows/ (not .github/workflow/)yamllint .github/workflows/*.ymlon: push: branches: [main]Symptoms: CodeQL workflow completes but finds nothing
Solutions:
- name: Build project
run: ./mvnw clean install
language: ['java-kotlin'] # Not just 'java'
Symptoms: Secret not found or empty variable
Solutions:
gh secret list${{ secrets.NAME }}Symptoms: Automated PRs fail CI checks
Solutions:
on:
push:
branches: [dependabot/**]
Symptoms: All matrix jobs fail with same error
Solutions:
matrix.:
node-version: ${{ matrix.node-version }} # NOT ${{ node-version }}
matrix:
node-version: [18, 20, 22] # Valid LTS versions
fail-fast: false to see all failures:
strategy:
fail-fast: false
Use this checklist to verify your GitHub automation setup:
Workflows:
.github/workflows/ directoryIssue Templates:
.github/ISSUE_TEMPLATE/ directoryrequired: true for critical fieldsPR Template:
.github/Security:
security-events: write permissionTesting:
Documentation:
Questions? Issues?
references/common-errors.md for all 18 errorsyamllint .github/workflows/*.ymlgh secret listPhase 1 Complete - Core templates and documentation ready Phase 2-4 Pending - Advanced workflows, scripts, additional guides
Last Updated: 2025-11-06 Version: 1.0.0 Status: Production Ready (Phase 1 Complete)