github-project-automation
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
NPX Install
npx skill4agent add ovachiever/droid-tings github-project-automationTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →GitHub Project Automation
Quick Start (15 Minutes)
1. Choose Your Framework
# 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- Pre-validated YAML prevents syntax errors
- SHA-pinned actions for security
- Explicit runner versions (ubuntu-24.04)
- All 8 GitHub Actions errors prevented
2. Add Issue Templates
# 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/- Required field validation (Error #12 prevented)
- Consistent data structure
- Better user experience
- No incomplete issues
3. Enable Security Scanning
# 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- CodeQL requires specific permissions (security-events: write)
- Dependabot has 10 PR limit per ecosystem
- Both must run on Dependabot PRs (Error #13 prevention)
The 5-Step Complete Setup Process
Step 1: Repository 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/)- workflows/ is plural
- ISSUE_TEMPLATE/ is singular (legacy naming)
- dependabot.yml goes in .github/, NOT workflows/
Step 2: Select Workflow Templates
- - Generic test/lint/build (all frameworks)
ci-basic.yml - - Node.js with matrix testing (18, 20, 22)
ci-node.yml - - Python with matrix testing (3.10, 3.11, 3.12)
ci-python.yml - - React/TypeScript with type checking
ci-react.yml
ci-cloudflare-workers.ymlsecurity-codeql.ymldependabot.yml# 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.ymlStep 3: Configure Secrets (if deploying)
# Using gh CLI
gh secret set CLOUDFLARE_API_TOKEN
# Paste your token when prompted
# Verify
gh secret list# ✅ CORRECT
env:
API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# ❌ WRONG - Missing double braces
env:
API_TOKEN: $secrets.CLOUDFLARE_API_TOKENStep 4: Add Issue/PR Templates
cp templates/issue-templates/bug_report.yml .github/ISSUE_TEMPLATE/
cp templates/issue-templates/feature_request.yml .github/ISSUE_TEMPLATE/cp templates/pr-templates/PULL_REQUEST_TEMPLATE.md .github/- Issue templates: YAML for validation
- PR template: Markdown (GitHub limitation)
Step 5: Customize for Your Project
-
Update usernames/emails:yaml
# In issue templates assignees: - jezweb # ← Change to your GitHub username # In dependabot.yml reviewers: - "jezweb" # ← Change to your username -
Adjust languages (CodeQL):yaml
# 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):yaml
# In dependabot.yml - package-ecosystem: "npm" # ← Change if using yarn/pnpm/pip/etc -
Set deployment URL (Cloudflare):yaml
# In ci-cloudflare-workers.yml echo "Worker URL: https://your-worker.your-subdomain.workers.dev" # ← Update with your actual Worker URL
Critical Rules
Always Do
# ✅ CORRECT
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# ❌ WRONG
- uses: actions/checkout@latest# ✅ CORRECT
runs-on: ubuntu-24.04 # Locked to specific LTS
# ❌ RISKY
runs-on: ubuntu-latest # Changes over time# ✅ CORRECT
${{ secrets.API_TOKEN }}
# ❌ WRONG
$secrets.API_TOKEN# Use yamllint or GitHub's workflow validator
yamllint .github/workflows/*.ymlgit checkout -b test/github-actions
# Push and verify CI runs before merging to mainNever Do
- Breaks without warning when actions update
- Security risk (unvetted versions auto-adopted)
# ❌ NEVER DO THIS
env:
API_TOKEN: "sk_live_abc123..." # Secret exposed in repo!# ❌ 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- DevDependencies run during build, can execute malicious code
- Include both prod and dev dependencies
# ❌ OLD WAY
.github/ISSUE_TEMPLATE.md
# ✅ NEW WAY
.github/ISSUE_TEMPLATE/
bug_report.yml
feature_request.ymlKnown Issues Prevention
Issue #1: YAML Indentation Errors
workflow file is invalid. mapping values are not allowed in this contextIssue #2: Missing run
or uses
Field
runusesError: Step must have a run or uses keyIssue #3: Action Version Pinning Issues
@latest@v4Issue #4: Incorrect Runner Version
ubuntu-latestubuntu-24.04Issue #5: Multiple Keys with Same Name
duplicate key found in mappingIssue #6: Secrets Not Available
Secret not found$secrets.NAME${{ secrets.NAME }}Issue #7: Matrix Strategy Errors
Issue #8: Context Syntax Errors
${{ }}Issue #9: Overly Complex Templates
Issue #10: Generic Prompts Without Context
Issue #11: Multiple Template Confusion
ISSUE_TEMPLATE.mdISSUE_TEMPLATE/Issue #12: Missing Required Fields
required: trueIssue #13: CodeQL Not Running on Dependabot PRs
push: branches: [dependabot/**]Issue #14: Branch Protection Blocking All PRs
Issue #15: Compiled Language CodeQL Setup
No code found to analyzeIssue #16: Development Dependencies Ignored
Issue #17: Dependabot Alert Limit
Issue #18: Workflow Duplication
references/common-errors.mdConfiguration Files Reference
dependabot.yml (Full Example)
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"- Weekly schedule reduces noise vs daily
- 10 PR limit matches GitHub maximum
- Includes devDependencies (Error #16 prevention)
- Reviewers auto-assigned for faster triage
- Conventional commit prefixes (chore: for deps)
CodeQL Workflow (security-codeql.yml)
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- is REQUIRED for CodeQL uploads
security-events: write - Without it, workflow fails silently
Common Patterns
Pattern 1: Multi-Framework Matrix Testing
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 testPattern 2: Conditional Deployment
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 }}Pattern 3: Artifact Upload/Download
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/Using Bundled Resources
Scripts (scripts/)
- - Interactive setup wizard
setup-github-project.sh - - YAML validation before commit
validate-workflows.sh - - Auto-generate from git log
generate-codeowners.sh - - Update existing projects
sync-templates.sh
./scripts/setup-github-project.sh react
# Prompts for project details, generates .github/ structureReferences (references/)
- - All 18 errors with solutions (complete)
references/common-errors.md - - Complete Actions API (Phase 2)
references/github-actions-reference.md - - YAML syntax guide (Phase 2)
references/workflow-syntax.md - - Dependabot deep-dive (Phase 2)
references/dependabot-guide.md - - CodeQL configuration (Phase 2)
references/codeql-guide.md - - Secrets best practices (Phase 2)
references/secrets-management.md - - Matrix patterns (Phase 2)
references/matrix-strategies.md
Templates (templates/)
- Phase 1 (complete): ci-basic, ci-node, ci-python, ci-react, ci-cloudflare-workers, security-codeql
- Phase 2: ci-matrix, cd-production, release, pr-checks, scheduled-maintenance, security-dependency-review
- Phase 1 (complete): bug_report.yml, feature_request.yml
- Phase 2: documentation.yml, config.yml
- Phase 1 (complete): PULL_REQUEST_TEMPLATE.md
- Phase 2: feature.md, bugfix.md
- Phase 1 (complete): dependabot.yml
- Phase 2: SECURITY.md, codeql-config.yml
- Phase 2: CODEOWNERS, FUNDING.yml
Integration with Existing Skills
cloudflare-worker-base → Add CI/CD
# 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_TOKENproject-planning → Generate Automation
# 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/open-source-contributions → Setup Contributor Experience
# 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/Advanced Topics
Integrating with GitHub Projects v2
/planning/github-projects-poc-findings.mdCustom Workflow Composition
# 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, deployMulti-Environment Deployments
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 productionwrangler.jsoncDependencies
- Git 2.0+ - Version control
- GitHub CLI (gh) 2.0+ - Secret management, PR creation (optional but recommended)
- yamllint 1.20+ - YAML validation before commit
- act (local GitHub Actions runner) - Test workflows locally
# macOS
brew install gh
# Ubuntu
sudo apt install gh
# Verify
gh --versionOfficial Documentation
- GitHub Actions: https://docs.github.com/en/actions
- Workflow Syntax: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
- CodeQL: https://codeql.github.com/docs/
- Dependabot: https://docs.github.com/en/code-security/dependabot
- Issue Templates: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests
/websites/github/github/Package Versions (Verified 2025-11-06)
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# Check latest action versions
gh api repos/actions/checkout/releases/latest
gh api repos/github/codeql-action/releases/latestProduction Example
- Template Used: ci-react.yml
- Build Time: 2m 15s (CI), 45s (local)
- Errors: 0 (all 18 known issues prevented)
- Validation: ✅ Type checking, linting, testing, build, CodeQL
- Template Used: ci-cloudflare-workers.yml
- Deploy Time: 1m 30s (automated)
- Errors: 0
- Validation: ✅ Deployed to production, Wrangler deployment successful
- Template Used: ci-python.yml (matrix)
- Test Time: 3m 45s (3 Python versions in parallel)
- Errors: 0
- Validation: ✅ Matrix testing on 3.10, 3.11, 3.12
Troubleshooting
Problem: Workflow not triggering
- Check workflow is in (not
.github/workflows/).github/workflow/ - Verify YAML is valid:
yamllint .github/workflows/*.yml - Check trigger matches your branch:
on: push: branches: [main] - Ensure workflow file is committed and pushed
- Check Actions tab in GitHub for error messages
Problem: CodeQL failing with "No code found"
- For compiled languages (Java, C++, C#), add build step:
yaml
- name: Build project run: ./mvnw clean install - Verify language is correct in matrix:
yaml
language: ['java-kotlin'] # Not just 'java' - Check CodeQL supports your language (see docs)
Problem: Secrets not available in workflow
Secret not found- Verify secret added to repository:
gh secret list - Check syntax uses double braces:
${{ secrets.NAME }} - Secrets are case-sensitive (use exact name)
- For forks, secrets aren't available (security)
Problem: Dependabot PRs keep failing
- Ensure CodeQL triggers on Dependabot PRs:
yaml
on: push: branches: [dependabot/**] - Check branch protection doesn't block bot PRs
- Verify tests pass with updated dependencies locally
- Review Dependabot logs: Settings → Security → Dependabot
Problem: Matrix builds all failing
- Check variable reference includes :
matrix.yamlnode-version: ${{ matrix.node-version }} # NOT ${{ node-version }} - Verify matrix values are valid:
yaml
matrix: node-version: [18, 20, 22] # Valid LTS versions - Use to see all failures:
fail-fast: falseyamlstrategy: fail-fast: false
Complete Setup Checklist
- Created directory
.github/workflows/ - Copied appropriate CI workflow template
- Updated usernames in workflow files
- Configured secrets (if deploying)
- SHA-pinned all actions (not @latest)
- Explicit runner version (ubuntu-24.04)
- Workflow triggers match branches (main/master)
- Created directory
.github/ISSUE_TEMPLATE/ - Copied bug_report.yml
- Copied feature_request.yml
- Updated assignees to your GitHub username
- YAML templates use for critical fields
required: true
- Copied PULL_REQUEST_TEMPLATE.md to
.github/ - Customized checklist for your project needs
- Copied security-codeql.yml
- Added correct languages to CodeQL matrix
- Set permission
security-events: write - Copied dependabot.yml
- Updated package-ecosystem (npm/pip/etc.)
- Set reviewers in dependabot.yml
- Pushed to feature branch first (not main)
- Verified CI runs successfully
- Checked Actions tab for any errors
- Validated YAML syntax locally
- Tested secret access (if applicable)
- Added badge to README.md (optional)
- Documented required secrets in README
- Updated CONTRIBUTING.md (if open source)
- Check for all 18 errors
references/common-errors.md - Verify workflow YAML is valid:
yamllint .github/workflows/*.yml - Check GitHub Actions tab for detailed error messages
- Review official docs: https://docs.github.com/en/actions
- Ensure secrets are configured:
gh secret list