Skip to content
Back to skills

Ci Workflow

BSecurity

Generate GitHub Actions workflows that use devflow CLI for migrations, deployments, and validation

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
databasespythonbashsqldockergitapidatabaseci/cd

Works with

  • cli
  • api

Security analysis

B84/100
  • criticalSends environment variables or credentials to an external URL
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill ci-workflow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ci Workflow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ci Workflow
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-ci-workflow/badge)](https://www.skillsdirectory.com/skills/david-li0406-ci-workflow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ci-workflow
description: Generate GitHub Actions workflows that use devflow CLI for migrations, deployments, and validation
allowed-tools: Bash, Read, Write, Glob
disable-model-invocation: true
argument-hint: [pr-check|deploy-staging|deploy-production|migration-check]
---

# Generate CI/CD Workflow

Create GitHub Actions workflows that leverage devflow CLI for consistent CI/CD operations.

## Usage

- `/devflow-ci-workflow pr-check` - PR validation (lint, test, migration dry-run)
- `/devflow-ci-workflow deploy-staging` - Deploy to staging on merge to main
- `/devflow-ci-workflow deploy-production` - Deploy to production on release tag
- `/devflow-ci-workflow migration-check` - Validate migrations are safe
- `/devflow-ci-workflow full` - Generate all workflows

## Workflow Type

$ARGUMENTS

## Workflow Templates

### PR Check Workflow

**File:** `.github/workflows/pr-check.yml`

```yaml
name: PR Check

on:
  pull_request:
    branches: [main, develop]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install devflow
        run: pip install -e .

      - name: Validate configuration
        run: devflow config validate

      - name: Check migration status
        run: devflow db status --env staging --json
        env:
          DATABASE_URL: ${{ secrets.STAGING_DATABASE_URL }}

      - name: Dry-run migrations
        run: devflow db migrate --env staging --dry-run --json
        env:
          DATABASE_URL: ${{ secrets.STAGING_DATABASE_URL }}

  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:15
        env:
          POSTGRES_PASSWORD: postgres
          POSTGRES_DB: test
        ports:
          - 5432:5432
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5

    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install -e ".[dev]"

      - name: Run tests
        run: pytest --cov
        env:
          DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test
```

### Deploy Staging Workflow

**File:** `.github/workflows/deploy-staging.yml`

```yaml
name: Deploy Staging

on:
  push:
    branches: [main]

concurrency:
  group: deploy-staging
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install devflow
        run: pip install -e .

      - name: Validate configuration
        run: devflow config validate

      - name: Apply migrations
        run: devflow db migrate --env staging --ci --json
        env:
          DATABASE_URL: ${{ secrets.STAGING_DATABASE_URL }}

      - name: Deploy to staging
        run: devflow deploy staging --ci --json
        env:
          DOCKER_HOST: ${{ secrets.STAGING_DOCKER_HOST }}
          DOCKER_TLS_VERIFY: 1

      - name: Verify deployment
        run: devflow deploy status --env staging --json
        env:
          DOCKER_HOST: ${{ secrets.STAGING_DOCKER_HOST }}

      - name: Notify on failure
        if: failure()
        uses: slackapi/slack-github-action@v1
        with:
          payload: |
            {
              "text": "Staging deployment failed for ${{ github.repository }}"
            }
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
```

### Deploy Production Workflow

**File:** `.github/workflows/deploy-production.yml`

```yaml
name: Deploy Production

on:
  release:
    types: [published]

concurrency:
  group: deploy-production
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install devflow
        run: pip install -e .

      - name: Validate configuration
        run: devflow config validate

      - name: Check migration status
        id: migration-check
        run: |
          STATUS=$(devflow db status --env production --json)
          PENDING=$(echo $STATUS | jq '.pending_count')
          echo "pending=$PENDING" >> $GITHUB_OUTPUT
        env:
          DATABASE_URL: ${{ secrets.PRODUCTION_DATABASE_URL }}

      - name: Apply migrations
        if: steps.migration-check.outputs.pending > 0
        run: devflow db migrate --env production --ci --json
        env:
          DATABASE_URL: ${{ secrets.PRODUCTION_DATABASE_URL }}

      - name: Deploy to production
        run: devflow deploy production --ci --json
        env:
          DOCKER_HOST: ${{ secrets.PRODUCTION_DOCKER_HOST }}
          DOCKER_TLS_VERIFY: 1

      - name: Verify deployment
        run: devflow deploy status --env production --json
        env:
          DOCKER_HOST: ${{ secrets.PRODUCTION_DOCKER_HOST }}

      - name: Create deployment record
        uses: actions/github-script@v7
        with:
          script: |
            await github.rest.repos.createDeployment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              ref: context.sha,
              environment: 'production',
              auto_merge: false,
              required_contexts: []
            });
```

### Migration Check Workflow

**File:** `.github/workflows/migration-check.yml`

```yaml
name: Migration Safety Check

on:
  pull_request:
    paths:
      - 'migrations/**'
      - 'supabase/migrations/**'

jobs:
  check-migrations:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install devflow
        run: pip install -e .

      - name: Get changed migrations
        id: changed
        run: |
          MIGRATIONS=$(git diff --name-only origin/main...HEAD -- 'migrations/*.sql' 'supabase/migrations/*.sql')
          echo "files=$MIGRATIONS" >> $GITHUB_OUTPUT

      - name: Analyze migrations for safety
        run: |
          echo "Checking migrations for potentially dangerous operations..."
          for file in ${{ steps.changed.outputs.files }}; do
            echo "Analyzing: $file"

            # Check for destructive operations
            if grep -iE "DROP TABLE|DROP COLUMN|TRUNCATE" "$file"; then
              echo "::warning file=$file::Contains destructive operation"
            fi

            # Check for missing transactions
            if ! grep -iE "BEGIN|START TRANSACTION" "$file"; then
              echo "::notice file=$file::Consider wrapping in transaction"
            fi

            # Check for long-running operations
            if grep -iE "ALTER TABLE.*ADD COLUMN.*NOT NULL" "$file"; then
              echo "::warning file=$file::Adding NOT NULL column may lock table"
            fi
          done

      - name: Dry-run against staging
        run: devflow db migrate --env staging --dry-run --json
        env:
          DATABASE_URL: ${{ secrets.STAGING_DATABASE_URL }}
```

## Generation Workflow

### Step 1: Check Existing Workflows

```bash
ls -la .github/workflows/
```

Identify what already exists to avoid overwriting.

### Step 2: Read Project Configuration

```bash
devflow config show --format yaml
```

Understand:
- Database configuration
- Deployment targets
- Environment names

### Step 3: Generate Requested Workflow

Create the workflow file in `.github/workflows/`.

### Step 4: Identify Required Secrets

List secrets that need to be configured in GitHub:

```
Required GitHub Secrets:
------------------------
STAGING_DATABASE_URL    - PostgreSQL connection string for staging
PRODUCTION_DATABASE_URL - PostgreSQL connection string for production
STAGING_DOCKER_HOST     - Docker host for staging deployment
PRODUCTION_DOCKER_HOST  - Docker host for production deployment
SLACK_WEBHOOK           - (optional) Slack notification webhook
```

### Step 5: Validate Generated Workflow

```bash
# Check YAML syntax
python -c "import yaml; yaml.safe_load(open('.github/workflows/<name>.yml'))"
```

## Customization Points

When generating, ask about:

1. **Branch names**: main vs master, develop branch?
2. **Python version**: 3.10, 3.11, 3.12?
3. **Test framework**: pytest, unittest?
4. **Notification**: Slack, Discord, email?
5. **Environments**: staging only, or staging + production?
6. **Manual approval**: Required for production?

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…