github-actions-generator
Original:🇺🇸 English
Translated
2 scriptsChecked / no sensitive code detected
Comprehensive toolkit for generating best practice GitHub Actions workflows, custom local actions, and configurations following current standards and conventions. Use this skill when creating new GitHub Actions resources, implementing CI/CD workflows, or building reusable actions.
2installs
Added on
NPX Install
npx skill4agent add akin-ozer/cc-devops-skills github-actions-generatorTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →GitHub Actions Generator
Generate production-ready GitHub Actions workflows and custom actions following current best practices, security standards, and naming conventions. All generated resources are automatically validated using the devops-skills:github-actions-validator skill.
Quick Reference
| Capability | When to Use | Reference |
|---|---|---|
| Workflows | CI/CD, automation, testing | |
| Composite Actions | Reusable step combinations | |
| Docker Actions | Custom environments/tools | |
| JavaScript Actions | API interactions, complex logic | |
| Reusable Workflows | Shared patterns across repos | |
| Security Scanning | Dependency review, SBOM | |
| Modern Features | Summaries, environments | |
Core Capabilities
1. Generate Workflows
Triggers: "Create a workflow for...", "Build a CI/CD pipeline..."
Process:
- Understand requirements (triggers, runners, dependencies)
- Reference for patterns
references/best-practices.md - Reference for action versions
references/common-actions.md - Generate workflow with:
- Semantic names, pinned actions (SHA), proper permissions
- Concurrency controls, caching, matrix strategies
- Validate with devops-skills:github-actions-validator skill
- Fix issues and re-validate if needed
Minimal Example:
yaml
name: CI Pipeline
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test2. Generate Custom Actions
Triggers: "Create a composite action...", "Build a Docker action...", "Create a JavaScript action..."
Types:
- Composite: Combine multiple steps → Fast startup
- Docker: Custom environment/tools → Isolated
- JavaScript: API access, complex logic → Fastest
Process:
- Use templates from
assets/templates/action/ - Follow structure in
references/custom-actions.md - Include branding, inputs/outputs, documentation
- Validate with devops-skills:github-actions-validator skill
See for:
references/custom-actions.md- Action metadata and branding
- Directory structure patterns
- Versioning and release workflows
3. Generate Reusable Workflows
Triggers: "Create a reusable workflow...", "Make this workflow callable..."
Key Elements:
- trigger with typed inputs
workflow_call - Explicit secrets (avoid )
secrets: inherit - Outputs mapped from job outputs
- Minimal permissions
yaml
on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
deploy-token:
required: true
outputs:
result:
value: ${{ jobs.build.outputs.result }}See for complete patterns.
references/advanced-triggers.md4. Generate Security Workflows
Triggers: "Add security scanning...", "Add dependency review...", "Generate SBOM..."
Components:
- Dependency Review:
actions/dependency-review-action@v4 - SBOM Attestations:
actions/attest-sbom@v2 - CodeQL Analysis:
github/codeql-action
Required Permissions:
yaml
permissions:
contents: read
security-events: write # For CodeQL
id-token: write # For attestations
attestations: write # For attestationsSee section on security.
references/best-practices.md5. Modern Features
Triggers: "Add job summaries...", "Use environments...", "Run in container..."
See for:
references/modern-features.md- Job summaries ()
$GITHUB_STEP_SUMMARY - Deployment environments with approvals
- Container jobs with services
- Workflow annotations
6. Public Action Documentation
When using public actions:
-
Search for documentation:
"[owner/repo] [version] github action documentation" -
Or use Context7 MCP:
- to find action
mcp__context7__resolve-library-id - for documentation
mcp__context7__get-library-docs
-
Pin to SHA with version comment:yaml
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
See for pre-verified action versions.
references/common-actions.mdValidation Workflow
CRITICAL: Every generated resource MUST be validated.
- Generate workflow/action file
- Invoke skill
devops-skills:github-actions-validator - If errors: fix and re-validate
- If success: present with usage instructions
Skip validation only for:
- Partial code snippets
- Documentation examples
- User explicitly requests skip
Mandatory Standards
All generated resources must follow:
| Standard | Implementation |
|---|---|
| Security | Pin to SHA, minimal permissions, mask secrets |
| Performance | Caching, concurrency, shallow checkout |
| Naming | Descriptive names, lowercase-hyphen files |
| Error Handling | Timeouts, cleanup with |
See for complete guidelines.
references/best-practices.mdResources
Reference Documents
| Document | Content | When to Use |
|---|---|---|
| Security, performance, patterns | Every workflow |
| Action versions, inputs, outputs | Public action usage |
| | Complex conditionals |
| workflow_run, dispatch, ChatOps | Workflow orchestration |
| Metadata, structure, versioning | Custom action creation |
| Summaries, environments, containers | Enhanced workflows |
Templates
| Template | Location |
|---|---|
| Basic Workflow | |
| Composite Action | |
| Docker Action | |
| JavaScript Action | |
Common Patterns
Matrix Testing
yaml
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [18, 20, 22]
fail-fast: falseConditional Deployment
yaml
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'Artifact Sharing
yaml
# Upload
- uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}
path: dist/
# Download (in dependent job)
- uses: actions/download-artifact@v4
with:
name: build-${{ github.sha }}Workflow Summary
- Understand requirements
- Reference appropriate docs
- Generate with standards
- Search for public action docs (if needed)
- Validate with devops-skills:github-actions-validator
- Fix any errors
- Present validated result