Loading...
Loading...
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 skill4agent add ovachiever/droid-tings github-project-automation# 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# 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/# 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# 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/)ci-basic.ymlci-node.ymlci-python.ymlci-react.ymlci-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.yml# 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_TOKENcp 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/# In issue templates
assignees:
- jezweb # ← Change to your GitHub username
# In dependabot.yml
reviewers:
- "jezweb" # ← Change to your username# In security-codeql.yml
matrix:
language: ['javascript-typescript'] # ← Add your languages
# Options: c-cpp, csharp, go, java-kotlin, python, ruby, swift# In dependabot.yml
- package-ecosystem: "npm" # ← Change if using yarn/pnpm/pip/etc# In ci-cloudflare-workers.yml
echo "Worker URL: https://your-worker.your-subdomain.workers.dev"
# ← Update with your actual Worker URL# ✅ 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 main# ❌ 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# ❌ OLD WAY
.github/ISSUE_TEMPLATE.md
# ✅ NEW WAY
.github/ISSUE_TEMPLATE/
bug_report.yml
feature_request.ymlworkflow file is invalid. mapping values are not allowed in this contextrunusesError: Step must have a run or uses key@latest@v4ubuntu-latestubuntu-24.04duplicate key found in mappingSecret not found$secrets.NAME${{ secrets.NAME }}${{ }}ISSUE_TEMPLATE.mdISSUE_TEMPLATE/required: truepush: branches: [dependabot/**]No code found to analyzereferences/common-errors.mdversion: 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"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@ea9e4e37992a54ee68a9622e985e60c8e8f12d9fsecurity-events: writestrategy:
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 testjobs:
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- run: npx wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}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/setup-github-project.shvalidate-workflows.shgenerate-codeowners.shsync-templates.sh./scripts/setup-github-project.sh react
# Prompts for project details, generates .github/ structurereferences/common-errors.mdreferences/github-actions-reference.mdreferences/workflow-syntax.mdreferences/dependabot-guide.mdreferences/codeql-guide.mdreferences/secrets-management.mdreferences/matrix-strategies.md# 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# 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/# 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//planning/github-projects-poc-findings.md# 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, deployjobs:
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.jsonc# macOS
brew install gh
# Ubuntu
sudo apt install gh
# Verify
gh --version/websites/github/github/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/latest.github/workflows/.github/workflow/yamllint .github/workflows/*.ymlon: push: branches: [main]- name: Build project
run: ./mvnw clean installlanguage: ['java-kotlin'] # Not just 'java'Secret not foundgh secret list${{ secrets.NAME }}on:
push:
branches: [dependabot/**]matrix.node-version: ${{ matrix.node-version }} # NOT ${{ node-version }}matrix:
node-version: [18, 20, 22] # Valid LTS versionsfail-fast: falsestrategy:
fail-fast: false.github/workflows/.github/ISSUE_TEMPLATE/required: true.github/security-events: writereferences/common-errors.mdyamllint .github/workflows/*.ymlgh secret list