Github actions

From tinh2/skills-hub-registry · View interactive version

Github actions is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Detect project stack and generate GitHub Actions CI/CD workflows — PR checks with lint/test/build/security, deploy pipelines for Vercel/AWS/GCP/Fly/Docker, dependency caching, matrix testing, preview deploys, and Dependabot config

How to use this skill

Skill file

You are in AUTONOMOUS MODE. Do NOT ask questions. Do NOT pause for confirmation.

Execute every phase below in sequence, making decisions based on what you find.

============================================================

PHASE 0 — INPUT

============================================================

$ARGUMENTS may contain:

============================================================

PHASE 1 — STACK DETECTION

============================================================

Detect the project stack by scanning for manifest files:

Node.js / TypeScript:

Python:

Go:

Rust:

Flutter / Dart:

Docker:

Record: language, package manager, framework, test command, build command, lint command.

============================================================

PHASE 2 — GENERATE PR CHECK WORKFLOW

============================================================

Create .github/workflows/ci.yml:

name: CI
on:
  pull_request:
    branches: [main, master]
  push:
    branches: [main, master]

Include these jobs in order:

1. Lint & Format

2. Type Check (if applicable)

3. Test

4. Build

5. Security Scan

Caching — always include appropriate caching:

Matrix testing (if --matrix):

Permissions: Use minimal permissions per job (never write-all).

============================================================

PHASE 3 — GENERATE DEPLOY WORKFLOW

============================================================

Create .github/workflows/deploy.yml based on deploy target:

Vercel: Use amondnet/vercel-action@v25 or Vercel CLI. Production deploy on push to main. Preview deploy on PR (if --preview).

AWS (ECS/ECR): Configure AWS credentials via OIDC (aws-actions/configure-aws-credentials@v4), login to ECR, build/tag/push Docker image, update ECS service.

AWS (S3 + CloudFront): Sync build output to S3, invalidate CloudFront distribution.

GCP (Cloud Run): Auth with google-github-actions/auth@v2, deploy with google-github-actions/deploy-cloudrun@v2.

Fly.io: Setup flyctl, deploy with flyctl deploy --remote-only.

Cloudflare (Pages/Workers): Use cloudflare/wrangler-action@v3.

Docker Registry (GHCR): Login with docker/login-action@v3, build/push with docker/build-push-action@v5 with layer caching. Tag with SHA and latest.

npm / PyPI: Publish on release tag creation. npm: npm publish with NODE_AUTH_TOKEN. PyPI: pypa/gh-action-pypi-publish@release/v1.

Include environment protection rules:

environment:
  name: production
  url: ${{ steps.deploy.outputs.url }}

============================================================

PHASE 4 — GENERATE ADDITIONAL WORKFLOWS

============================================================

If applicable, also create:

Release workflow (.github/workflows/release.yml):

Preview deploy (if --preview):

Dependabot (.github/dependabot.yml):

============================================================

PHASE 5 — SECRETS DOCUMENTATION

============================================================

Create or update .github/SECRETS.md listing all required repository secrets:

## Required Secrets

| Secret | Description | Where to get it |
|--------|-------------|-----------------|
| DEPLOY_TOKEN | Vercel/Fly/etc deploy token | {provider dashboard URL} |

List every ${{ secrets.* }} reference used in the generated workflows.

============================================================

SELF-HEALING VALIDATION (max 2 iterations)

============================================================

After completing deployment/infrastructure changes, validate:

  1. Verify all generated files are syntactically valid (YAML, JSON, HCL, Dockerfile).
  2. Run validation commands if available (terraform validate, docker build --check, kubectl dry-run).
  3. Verify no secrets, credentials, or sensitive values are hardcoded.
  4. If validation fails, diagnose and fix the specific syntax or config error.
  5. Repeat up to 2 iterations.

IF STILL FAILING after 2 iterations:

============================================================

OUTPUT

============================================================

Print a summary of all generated files:

## GitHub Actions Setup Complete

### Files Created
- .github/workflows/ci.yml — PR checks (lint, typecheck, test, build, security)
- .github/workflows/deploy.yml — Deploy to {target} on push to main
- .github/dependabot.yml — Automated dependency updates
- .github/SECRETS.md — Required secrets documentation

### Required Secrets
{list of secrets to configure in GitHub repo settings}

### Detected Stack
- Language: {language}
- Framework: {framework}
- Package Manager: {pm}
- Deploy Target: {target}

============================================================

NEXT STEPS

============================================================

  1. Add required secrets to GitHub repository settings
  2. Push workflows to trigger the first run
  3. Enable branch protection rules requiring CI to pass before merge
  4. Review caching strategy after first run to verify cache hits
  5. Enable GitHub secret scanning and push protection on the repository

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /github-actions — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

============================================================

DO NOT

============================================================

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.