Skip to content

Latest commit

 

History

History
618 lines (457 loc) · 13.3 KB

GITHUB_ACTIONS.md

File metadata and controls

618 lines (457 loc) · 13.3 KB

GitHub Actions Integration

This document describes how to integrate SDLC compliance checking into your GitHub Actions workflows.

SDLC Skills

This repository provides SDLC skills that can be used by AI coding assistants:

Skill Domain What It Checks
sdlc:build Build System Makefile targets, dependency lockfiles, MSV
sdlc:quality Code Quality Formatting, linting configuration
sdlc:testing Testing Coverage config, test organization
sdlc:ci CI/CD Workflow structure, pinned versions
sdlc:security Security Vulnerability scanning, secret detection
sdlc:docs Documentation README sections, CHANGELOG, ADRs
sdlc:vcs Version Control Branch protection, commit conventions
sdlc:release Release Semantic versioning, release automation
sdlc:observability Observability Logging, metrics, health checks
sdlc:ai AI Config CLAUDE.md, copilot-instructions

Installation Options

Method Use Case How It Works
GitHub Copilot AI-powered audits Install skills in .github/skills/, Copilot uses them automatically
GitHub Action Standalone CI/CD uses: zircote/sdlc-quality@v1
Claude Code Interactive guidance claude plugins add github:zircote/sdlc-quality

GitHub Copilot (Recommended)

Install the SDLC skills in your project so GitHub Copilot coding agent can use them:

Option 1: Copy Skills

# Clone and copy skills to your project
git clone --depth 1 https://github.com/zircote/sdlc-quality.git /tmp/sdlc
cp -r /tmp/sdlc/.github/skills .github/skills
rm -rf /tmp/sdlc

# Commit the skills
git add .github/skills
git commit -m "feat: add SDLC skills for Copilot"

Option 2: Git Submodule

# Add as submodule
git submodule add https://github.com/zircote/sdlc-quality.git .github/sdlc-quality

# Create symlink for Copilot
ln -s sdlc-quality/.github/skills .github/skills

# Commit
git add .github/sdlc-quality .github/skills .gitmodules
git commit -m "feat: add SDLC skills submodule for Copilot"

Workflow for Copilot Audits

Create a workflow that triggers Copilot to run SDLC audits:

# .github/workflows/copilot-sdlc-audit.yml
name: Copilot SDLC Audit

on:
  issues:
    types: [assigned]
  workflow_dispatch:
    inputs:
      domains:
        description: "Domains to audit (comma-separated or 'all')"
        default: "all"

jobs:
  audit:
    if: |
      github.event_name == 'workflow_dispatch' ||
      contains(github.event.issue.labels.*.name, 'sdlc-audit')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      # Copilot coding agent automatically loads skills from .github/skills/
      # when assigned to issues or triggered via workflow_dispatch

Triggering Audits

  1. Via Issue: Create an issue with the sdlc-audit label and assign Copilot
  2. Via Workflow: Trigger manually from Actions tab
  3. Via PR Comment: @copilot run SDLC compliance audit

Copilot will use the skills in .github/skills/ to perform the audit.


GitHub Action (Standalone)

For CI/CD enforcement without Copilot:

- uses: zircote/sdlc-quality@v1
  with:
    domains: "all"
    fail-on-error: "true"

Claude Code Plugin

For interactive guidance:

claude plugins add github:zircote/sdlc-quality

Table of Contents

Overview

The GitHub Action provides two integration options:

  1. Direct Action (zircote/sdlc-quality@v1) - Use directly in your workflow steps (GitHub Marketplace compatible)
  2. Reusable Workflow (zircote/sdlc-quality/.github/workflows/sdlc-audit.yml@v1) - Call as a complete workflow

Both options support:

  • All 11 SDLC domains
  • Multiple report formats (Markdown, JSON, SARIF)
  • PR comments with results
  • GitHub issue creation for failures
  • GitHub Security tab integration (via SARIF)
  • Scheduled audits
  • Issue-triggered audits

Quick Start

Minimal Setup

Add to .github/workflows/sdlc.yml:

name: SDLC Compliance

on:
  pull_request:
  push:
    branches: [main]

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

      - name: Run SDLC Check
        uses: zircote/sdlc-quality@v1

With All Features

name: SDLC Compliance

on:
  pull_request:
  push:
    branches: [main]
  schedule:
    - cron: "0 9 * * 1" # Weekly on Monday

permissions:
  contents: read
  pull-requests: write
  issues: write
  security-events: write

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

      - name: Run SDLC Check
        id: sdlc
        uses: zircote/sdlc-quality@v1
        with:
          domains: "all"
          fail-on-error: "true"
          report-format: "all"
          upload-artifact: "true"
          create-pr-comment: "true"
          create-issue: "true"

      - name: Check Results
        run: |
          echo "Score: ${{ steps.sdlc.outputs.score }}/100"
          echo "Status: ${{ steps.sdlc.outputs.status }}"
          echo "Critical: ${{ steps.sdlc.outputs.critical-count }}"

Direct Action

Inputs

Input Description Default
domains Comma-separated domains or "all" all
fail-on-error Fail if MUST requirements not met true
report-format Format: markdown, json, sarif, all markdown
upload-artifact Upload report as artifact true
create-pr-comment Comment on PR with results true
create-issue Create issue for failures false
working-directory Directory to check .
config-file Custom configuration file ``

Outputs

Output Description
score Overall compliance score (0-100)
status Status: pass, warn, or fail
report-path Path to generated report
critical-count Number of MUST violations
important-count Number of SHOULD violations
suggestion-count Number of MAY suggestions

Domain Selection

Check specific domains:

- uses: zircote/sdlc-quality@v1
  with:
    domains: "security,ci,docs"

Available domains:

  • build - Build system (Makefile, dependencies)
  • quality - Code formatting and linting
  • testing - Test coverage and organization
  • ci - CI/CD pipeline configuration
  • security - Vulnerability scanning, secrets
  • docs - Documentation completeness
  • vcs - Version control practices
  • release - Versioning and release process
  • observability - Logging, metrics, health
  • ai - AI assistant configuration

Reusable Workflow

Call the complete audit workflow:

name: Weekly Audit

on:
  schedule:
    - cron: "0 9 * * 1"
  workflow_dispatch:

jobs:
  audit:
    uses: zircote/sdlc-quality/.github/workflows/sdlc-audit.yml@v1
    with:
      domains: "all"
      fail-on-error: false
      create-issue: true
    permissions:
      contents: read
      pull-requests: write
      issues: write
      security-events: write

Workflow Inputs

Same as composite action, plus:

Input Description Default
runner Runner to use ubuntu-latest

Workflow Outputs

Output Description
score Overall compliance score
status Compliance status
critical-count Critical violations
important-count Important violations

Trigger Modes

Pull Request

Automatically check PRs:

on:
  pull_request:
    types: [opened, synchronize, reopened]

Push to Protected Branch

Check on merge to main:

on:
  push:
    branches: [main, develop]

Scheduled

Weekly compliance audit:

on:
  schedule:
    - cron: "0 9 * * 1" # Monday 9am UTC

Manual Dispatch

On-demand with parameters:

on:
  workflow_dispatch:
    inputs:
      domains:
        description: "Domains to check"
        type: choice
        options: [all, security, ci, docs]
        default: "all"

Issue Assignment

Trigger audit when assigned to an issue:

on:
  issues:
    types: [assigned]

Create an issue with:

  • Title containing "SDLC", "compliance", or "audit"
  • Label sdlc-audit
  • Body with optional domains: security,ci line

Output Formats

Markdown Report

Human-readable report with:

  • Summary table
  • Domain scores
  • Prioritized findings
  • Remediation guidance
report-format: "markdown"

JSON Report

Machine-readable for tooling integration:

report-format: "json"

Structure:

{
  "project_name": "my-project",
  "score": 85,
  "status": "warn",
  "domain_scores": {
    "build": 10,
    "security": 7
  },
  "findings": [
    {
      "domain": "security",
      "severity": "important",
      "message": "No vulnerability scanning configured"
    }
  ]
}

SARIF Report

For GitHub Security tab integration:

report-format: "sarif"

Automatically uploads to GitHub Code Scanning when permissions allow.

All Formats

Generate all formats:

report-format: "all"

AI Agent Integration

GitHub Copilot Coding Agent

The repository includes copilot-setup-steps.yml for Copilot agent integration:

# .github/workflows/copilot-setup-steps.yml is pre-configured

See .github/copilot-instructions.md for Copilot-specific guidance.

Claude Code

Install the plugin:

claude plugins add github:zircote/sdlc-quality

Use slash commands:

/sdlc:check
/sdlc:init

OpenAI Codex

Refer to AGENTS.md in the repository root for Codex guidelines.

Examples

Security-Focused Check

name: Security Audit

on:
  pull_request:
    paths:
      - "Cargo.toml"
      - "package.json"
      - "requirements.txt"
      - ".github/workflows/**"

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

      - uses: zircote/sdlc-quality@v1
        with:
          domains: "security"
          fail-on-error: "true"
          create-pr-comment: "true"

Documentation Compliance

name: Docs Check

on:
  pull_request:
    paths:
      - "**.md"
      - "docs/**"

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

      - uses: zircote/sdlc-quality@v1
        with:
          domains: "docs,ai"
          fail-on-error: "false"

Multi-Platform Matrix

name: Cross-Platform SDLC

on: [push, pull_request]

jobs:
  compliance:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4

      - uses: zircote/sdlc-quality@v1
        with:
          domains: "build,testing"

Monorepo with Working Directory

name: Service SDLC

on: [push]

jobs:
  check-services:
    strategy:
      matrix:
        service: [api, web, worker]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: zircote/sdlc-quality@v1
        with:
          working-directory: "services/${{ matrix.service }}"
          upload-artifact: "true"

Troubleshooting

Action Not Found

Ensure you're using the correct path:

uses: zircote/sdlc-quality@v1

Permission Denied

Add required permissions:

permissions:
  contents: read
  pull-requests: write
  issues: write
  security-events: write

SARIF Upload Failed

SARIF upload requires security-events: write permission and is only available on public repos or with GitHub Advanced Security.

PR Comment Not Created

Ensure:

  1. create-pr-comment: 'true'
  2. Running on pull_request event
  3. pull-requests: write permission

False Positives

Use a config file to customize checks:

# .sdlc-config.sh
SKIP_DOMAINS="observability"
COVERAGE_THRESHOLD=70
- uses: zircote/sdlc-quality@v1
  with:
    config-file: ".sdlc-config.sh"

Support