Skip to content

Validation and local testing plugin that checks GitHub Actions workflows with act before pushing.

CCM score
42 of 100
GitHub stars
201
View on GitHub

Own this plugin? Claim it

What it does

  • Adds 3 skills (act-workflow-syntax, act-local-testing, act-docker-setup) and a Stop and SubagentStop hook running act --dryrun
  • Covers workflow syntax and triggers, act CLI usage, debugging, Docker runner images, and resource limits
  • Validates workflows automatically on session stop and agent completion, but only in projects with a .github/workflows directory
  • Designed for developers who test GitHub Actions locally with Docker before pushing changes to GitHub

Validation and quality enforcement for GitHub Actions workflows with act local testing.

Add marketplace

/plugin marketplace add TheBushidoCollective/han

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install act@han

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Act - Docker Configuration and Setup

Use this skill when configuring Docker for act, choosing runner images, managing container resources, and optimizing Docker performance for local GitHub Actions workflow testing.

Runner Images

Image Size Categories

Act supports three image size categories:

SizeImageToolsUse Case
Micronode:16-buster-slimMinimalSimple Node.js workflows
Mediumcatthehacker/ubuntu:act-*Common toolsMost workflows
Largecatthehacker/ubuntu:full-*EverythingMaximum compatibility

Official catthehacker Images

# Latest Ubuntu (22.04)
act -P ubuntu-latest=catthehacker/ubuntu:act-latest

# Specific Ubuntu versions
act -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
act -P ubuntu-20.04=catthehacker/ubuntu:act-20.04

# Full images (larger, more tools)
act -P ubuntu-latest=catthehacker/ubuntu:full-latest
act -P ubuntu-22.04=catthehacker/ubuntu:full-22.04

# Runner images (closest to GitHub)
act -P ubuntu-latest=catthehacker/ubuntu:runner-latest

Language-Specific Images

# Node.js
act -P ubuntu-latest=node:20
act -P ubuntu-latest=node:20-alpine

# Python
act -P ubuntu-latest=python:3.12
act -P ubuntu-latest=python:3.12-slim

# Go
act -P ubuntu-latest=golang:1.22
act -P ubuntu-latest=golang:1.22-alpine

# Ruby
act -P ubuntu-latest=ruby:3.3
act -P ubuntu-latest=ruby:3.3-alpine

Platform Configuration

.actrc Configuration

Create .actrc in project root for persistent settings:

# Default platform images
-P ubuntu-latest=catthehacker/ubuntu:act-latest
-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
-P ubuntu-20.04=catthehacker/ubuntu:act-20.04

# Reuse containers
--reuse

# Container options
--container-architecture linux/amd64
--container-daemon-socket -

# Resource limits
--container-cap-add SYS_PTRACE
--container-cap-add NET_ADMIN

Per-Workflow Configuration

Create .github/workflows/.actrc for workflow-specific settings:

-P ubuntu-latest=node:20
--env-file .env.ci

Command Line Override

# Override .actrc settings
act -P ubuntu-latest=python:3.12 --no-reuse

Container Management

Reusing Containers

# Reuse containers for faster iteration
act --reuse

# Reuse with specific job
act --reuse -j build

# Force recreate containers
act --rm

Container Lifecycle

# List running act containers
docker ps --filter "label=act"

# Stop all act containers
docker stop $(docker ps -q --filter "label=act")

# Remove all act containers
docker rm $(docker ps -aq --filter "label=act")

# Clean up act volumes
docker volume prune

Inspect Containers

# Exec into running container
docker exec -it act-<job-name> /bin/bash

# View container logs
docker logs act-<job-name>

# Inspect container config
docker inspect act-<job-name>

Volume Mounts and Binds

Default Mounts

Act automatically mounts:

  • Current directory → /github/workspace
  • Act cache → /root/.cache/act
  • Docker socket (if needed)

Custom Bind Mounts

# Mount additional directory
act --bind /host/path:/container/path

# Mount multiple directories
act --bind /data:/data --bind /config:/config

# Read-only mount
act --bind /readonly:/readonly:ro

Persistent Cache

# Configure cache location
export ACT_CACHE_DIR=$HOME/.cache/act

# Clean cache
rm -rf $HOME/.cache/act

Docker Configuration

Docker Socket

# Use default Docker socket
act --container-daemon-socket -

# Use custom socket
act --container-daemon-socket /var/run/docker.sock

# Use Docker Desktop socket (Mac)
act --container-daemon-socket unix:///Users/$USER/.docker/run/docker.sock

Container Architecture

# Specify architecture
act --container-architecture linux/amd64

# For Apple Silicon Macs
act --container-architecture linux/arm64

Network Configuration

# Use host network
act --network host

# Use custom network
act --network my-network

# Create isolated network
docker network create act-network
act --network act-network

Resource Management

Memory Limits

# Set memory limit
act --memory 4g

# Set memory and swap
act --memory 4g --memory-swap 8g

CPU Limits

# Limit CPU cores
act --cpus 2

# Set CPU shares
act --cpu-shares 512

Disk Space

# Check Docker disk usage
docker system df

# Clean up unused resources
docker system prune -a

# Remove old act cache
find ~/.cache/act -type d -mtime +30 -exec rm -rf {} +

Security

Capabilities

# Add Linux capabilities
act --container-cap-add SYS_PTRACE

# Drop capabilities
act --container-cap-drop ALL

# Security profile
act --security-opt seccomp=unconfined

Privileged Mode

# Run in privileged mode (use sparingly)
act --privileged

# Safer: add specific capabilities instead
act --container-cap-add SYS_ADMIN

Multi-Platform Builds

Docker Buildx

# Workflow using buildx
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: docker/setup-buildx-action@v3
      - uses: docker/build-push-action@v5
        with:
          platforms: linux/amd64,linux/arm64

Test with act:

# Enable buildx in act
act --use-gitignore=false \
    -P ubuntu-latest=catthehacker/ubuntu:act-latest

Troubleshooting

Image Pull Failures

# Pull image manually
docker pull catthehacker/ubuntu:act-latest

# Use cached image
act --pull=false

# Force pull latest
act --pull=true

Permission Issues

# Fix workspace permissions
act --container-options "--user $(id -u):$(id -g)"

# Run as root (not recommended)
act --container-options "--user root"

DNS Issues

# Use custom DNS
act --container-options "--dns 8.8.8.8"

# Use host DNS
act --container-options "--dns-search ."

Container Exit Codes

# Continue on error
act --continue-on-error

# Capture exit code
act; echo $?

Performance Optimization

Image Selection

Choose the smallest image that meets your needs:

# Fast but limited
act -P ubuntu-latest=node:20-alpine

# Balanced
act -P ubuntu-latest=catthehacker/ubuntu:act-latest

# Comprehensive but slow
act -P ubuntu-latest=catthehacker/ubuntu:full-latest

Layer Caching

# Optimize Dockerfile for caching
FROM node:20

# Install system deps first (changes rarely)
RUN apt-get update && apt-get install -y git

# Copy package files (changes sometimes)
COPY package*.json ./

# Install deps (changes sometimes)
RUN npm ci

# Copy source (changes often)
COPY . .

Parallel Jobs

# Run jobs in parallel
act --parallel

# Limit parallelism
act --parallel --jobs 2

Custom Images

Building Custom Image

Create Dockerfile:

FROM catthehacker/ubuntu:act-latest

# Add custom tools
RUN apt-get update && apt-get install -y \
    postgresql-client \
    redis-tools \
    && rm -rf /var/lib/apt/lists/*

# Install specific Node version
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs

# Install global npm packages
RUN npm install -g pnpm yarn

Build and use:

docker build -t my-act-runner .
act -P ubuntu-latest=my-act-runner

Publishing Custom Image

# Tag image
docker tag my-act-runner username/act-runner:latest

# Push to Docker Hub
docker push username/act-runner:latest

# Use in team
act -P ubuntu-latest=username/act-runner:latest

Best Practices

DO

✅ Use .actrc for consistent configuration across team ✅ Choose appropriate image size for your needs ✅ Use --reuse during development ✅ Clean up Docker resources regularly ✅ Pin image versions in production workflows ✅ Use layer caching for faster builds ✅ Document image requirements in README

DON'T

❌ Use :latest tags in production ❌ Run containers in privileged mode unnecessarily ❌ Ignore Docker disk space usage ❌ Use oversized images for simple workflows ❌ Commit large images to version control ❌ Skip Docker resource cleanup ❌ Expose sensitive data in container logs

Common Patterns

Development Setup

# Fast iteration setup
cat > .actrc << 'EOF'
-P ubuntu-latest=catthehacker/ubuntu:act-latest
--reuse
--rm=false
--container-architecture linux/amd64
EOF

CI Validation

# Strict validation setup
act --dryrun \
    --pull=true \
    --no-reuse \
    -P ubuntu-latest=catthehacker/ubuntu:full-latest

Monorepo Setup

# Different images per job
act -j backend -P ubuntu-latest=node:20 \
    -j frontend -P ubuntu-latest=node:20-alpine \
    -j database -P ubuntu-latest=postgres:16

Related Skills

  • act-workflow-syntax: Creating workflow files
  • act-local-testing: Testing workflows with act CLI
  • act-advanced-features: Advanced act usage patterns

Readme

Act

Validation and quality enforcement for GitHub Actions workflows with act local testing.

Overview

Act is a Han plugin that brings GitHub Actions workflow validation and local testing capabilities directly into your Claude Code workflow. Using act, this plugin enables you to test GitHub Actions workflows locally using Docker, catch issues before pushing to GitHub, and iterate rapidly on CI/CD configurations.

Features

🪝 Automatic Validation Hooks

  • Stop Hook: Validates all workflows before Claude Code stops
  • SubagentStop Hook: Validates workflows when agents complete tasks
  • Runs act --dryrun to catch syntax errors and configuration issues
  • Only validates in directories containing .github/workflows folder
  • Fast-fails to provide immediate feedback

📖 Comprehensive Skills

Three specialized skills provide deep knowledge of act and GitHub Actions:

act-workflow-syntax

Complete guide to GitHub Actions workflow files:

  • Workflow structure and top-level fields
  • Event triggers (push, pull_request, workflow_dispatch, schedule)
  • Job configuration and dependencies
  • Matrix builds and parallel execution
  • Steps, actions, and commands
  • Expressions, contexts, and functions
  • Act-specific considerations
act-local-testing

Local workflow testing with act CLI:

  • Installation across platforms (macOS, Linux, Windows)
  • Running workflows and specific jobs
  • Validation and dry runs
  • Secrets and environment variables
  • Debugging techniques
  • Troubleshooting common issues
  • Performance optimization tips
act-docker-setup

Docker configuration for act:

  • Runner image selection (micro, medium, large, custom)
  • Platform configuration with .actrc files
  • Container management and lifecycle
  • Volume mounts and persistent cache
  • Resource limits (memory, CPU, disk)
  • Security considerations
  • Multi-platform builds
  • Custom image creation

Installation

han plugin install act

Requirements

  • act: GitHub Actions local runner

    # macOS
    brew install act
    
    # Linux
    curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
    
    # Windows
    choco install act-cli
    # or
    scoop install act
    
  • Docker: Required for running act

Usage

Automatic Validation

This plugin automatically validates workflows when:

  1. You stop Claude Code - Ensures workflows are valid before ending session
  2. Agents complete tasks - Validates after automated changes

The validation only runs in projects with .github/workflows directory and uses act --dryrun for fast syntax checking without executing workflows.

Manual Testing

Use the included skills to test workflows manually:

# Validate all workflows
act --dryrun

# Run specific workflow
act -W .github/workflows/ci.yml

# Run specific job
act -j build

# Test with secrets
act --secret-file .secrets

# Use specific Docker image
act -P ubuntu-latest=catthehacker/ubuntu:act-latest

Skill Invocations

Claude Code will automatically use the appropriate skill when you:

  • Create or modify workflow files
  • Ask about GitHub Actions syntax
  • Need to test workflows locally
  • Configure Docker for act
  • Troubleshoot workflow issues

Configuration

.actrc Configuration

Create .actrc in your project root for consistent act settings:

# Platform mappings
-P ubuntu-latest=catthehacker/ubuntu:act-latest

# Default options
--reuse
--secret-file .secrets
--env-file .env

# Container options
--container-architecture linux/amd64

Secrets Management

Create .secrets file for local testing (add to .gitignore):

GITHUB_TOKEN=ghp_your_token_here
NPM_TOKEN=npm_your_token_here

Environment Variables

Create .env file for workflow environment variables:

NODE_ENV=development
DEBUG=true
LOG_LEVEL=debug

Best Practices

DO

✅ Test workflows locally before pushing ✅ Use act --dryrun to validate syntax ✅ Create .actrc for team consistency ✅ Keep .secrets in .gitignore ✅ Use --reuse flag for faster iteration ✅ Choose appropriate Docker image sizes ✅ Document act usage in project README

DON'T

❌ Commit .secrets or .env files ❌ Skip validation with --dryrun ❌ Use latest Docker tags in production ❌ Ignore Docker disk space usage ❌ Assume all actions work with act ❌ Run workflows without understanding them

Common Patterns

Development Workflow

# 1. Edit workflow
vim .github/workflows/ci.yml

# 2. Validate syntax
act --dryrun

# 3. Test locally
act --reuse -j build

# 4. Iterate quickly
act --reuse -j build

Pre-Push Validation

Add to .git/hooks/pre-push:

#!/bin/bash
echo "Validating workflows..."
act --dryrun
if [ $? -ne 0 ]; then
  echo "Workflow validation failed"
  exit 1
fi

CI/CD Testing

# Test full pipeline
act

# Test specific events
act push
act pull_request

# Test with production secrets
act --secret-file .secrets.prod

Troubleshooting

Workflows Not Found

# Check workflow files exist
ls -la .github/workflows/

# Validate YAML syntax
yamllint .github/workflows/*.yml

# List detected workflows
act -l

Docker Issues

# Check Docker is running
docker ps

# Pull required images
docker pull catthehacker/ubuntu:act-latest

# Clean up resources
docker system prune -a

Permission Issues

# Fix Docker permissions (Linux)
sudo usermod -aG docker $USER
newgrp docker

# Run with proper user
act --container-options "--user $(id -u):$(id -g)"

Philosophy

This plugin follows Han's validation and quality enforcement philosophy:

  1. Validate Early - Catch issues before they reach GitHub
  2. Local-First - Test workflows on your machine, not in CI
  3. Fast Feedback - Immediate validation on Stop/SubagentStop
  4. Minimal Friction - Automatic validation only in relevant projects
  5. Educational - Comprehensive skills teach act and GitHub Actions

Related Plugins

  • bushido:proof-of-work - Requires evidence of test execution
  • bushido:test-driven-development - TDD principles and practices
  • bushido:code-reviewer - Code review and quality checks

Resources

Details

Marketplace
TheBushidoCollective/han
Source
plugins/tools/act
Category
Tool
Keywords
github-actions, act, workflow, ci-cd, validation, local-testing, docker
Listed since
Apr 7, 2026

More from TheBushidoCollective/han

All 340

Similar to act

More DevOps & Cloud