act-local-testing
БесплатноБез исполняемых скриптовНе проверенUse when testing GitHub Actions workflows locally with act. Covers act CLI usage, Docker configuration, debugging workflows, and troubleshooting common issues…
от TheBushidoCollective★ 202 звезды на GitHubОб этом скилле
Act - Local Workflow Testing
Use this skill when testing GitHub Actions workflows locally with act. This covers act CLI commands, Docker setup, debugging, and best practices for fast local iteration on CI/CD workflows.
Installation
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
From Source
go install github.com/nektos/act@latest
Basic Usage
Run All Workflows
# Run workflows triggered by push event
act
# Equivalent to
act push
Run Specific Events
# Pull request event
act pull_request
# Workflow dispatch
act workflow_dispatch
# Custom event
act repository_dispatch -e event.json
Run Specific Workflows
# Run specific workflow file
act -W .github/workflows/ci.yml
# Run specific job
act -j build
# Run specific workflow and job
act -W .github/workflows/deploy.yml -j production
List Available Workflows
# List all workflows and jobs
act -l
# List for specific event
act pull_request -l
Validation and Dry Runs
Dry Run
# Validate without executing
act --dryrun
# Show what would run
act -n
# Validate specific workflow
act --dryrun -W .github/workflows/ci.yml
Graph Visualization
# Show workflow graph
act -g
# Show graph for specific event
act pull_request -g
Docker Configuration
Default Runners
Act uses Docker images to simulate GitHub's runners:
# Use default images (micro - minimal)
act
# Use medium images (more tools)
act -P ubuntu-latest=catthehacker/ubuntu:act-latest
# Use large images (most compatible)
act -P ubuntu-latest=catthehacker/ubuntu:full-latest
Custom Platform Images
Create .actrc file in project root:
-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
Or use command line:
act -P ubuntu-latest=node:18 \
-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
Reusing Docker Containers
# Reuse containers between runs (faster)
act --reuse
# Clean up after run
act --rm
Secrets Management
Using .secrets File
Create .secrets in project root:
GITHUB_TOKEN=ghp_your_token_here
NPM_TOKEN=npm_your_token_here
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
Add to .gitignore:
.secrets
Run with secrets:
act --secret-file .secrets
Inline Secrets
# Single secret
act -s GITHUB_TOKEN=ghp_token
# Multiple secrets
act -s GITHUB_TOKEN=ghp_token \
-s NPM_TOKEN=npm_token
Environment-Specific Secrets
# Development secrets
act --secret-file .secrets.dev
# Production secrets
act --secret-file .secrets.prod
Environment Variables
Setting Variables
# Single variable
act --env NODE_ENV=development
# Multiple variables
act --env NODE_ENV=development \
--env DEBUG=true
Using .env File
Create .env file:
NODE_ENV=development
DEBUG=true
LOG_LEVEL=debug
Run with env file:
act --env-file .env
GitHub Context Variables
Act automatically sets these:
GITHUB_ACTOR=nektos/act
GITHUB_REPOSITORY=owner/repo
GITHUB_EVENT_NAME=push
GITHUB_SHA=abc123...
GITHUB_REF=refs/heads/main
ACT=true
Debugging
Verbose Output
# Verbose mode
act -v
# Very verbose (debug)
act -vv
Step-by-Step Execution
# Interactive mode - pause before each step
act --watch
Inspect Containers
# Keep container running after workflow
act --reuse
# Then in another terminal
docker ps
docker exec -it <container-id> /bin/bash
Bind Mount Local Files
# Mount current directory
act --bind
# Mount specific directory
act -b /host/path:/container/path
Common Workflows
Test Before Push
# Validate workflow syntax
act --dryrun
# Run tests
act -j test
# Run full CI
act
Iterative Development
# Edit workflow
vim .github/workflows/ci.yml
# Test immediately
act --reuse -j build
# Iterate quickly
act --reuse -j build
Matrix Testing
# Run specific matrix combination
act --matrix os:ubuntu-latest --matrix node:20
# Run all combinations
act
Troubleshooting
Docker Issues
# Check Docker is running
docker ps
# Pull required images manually
docker pull catthehacker/ubuntu:act-latest
# Clean up Docker resources
docker system prune -a
Permission Issues
# Run with sudo (Linux)
sudo act
# Fix Docker permissions (Linux)
sudo usermod -aG docker $USER
newgrp docker
Missing Tools
# Use fuller image
act -P ubuntu-latest=catthehacker/ubuntu:full-latest
# Or install in workflow
- run: |
apt-get update
apt-get install -y some-tool
Workflow Not Found
# Check wor
Установить act-local-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobFAQ
Что делает скилл act-local-testing?
Use when testing GitHub Actions workflows locally with act. Covers act CLI usage, Docker configuration, debugging workflows, and troubleshooting common issues when running workflows on your local machine.
Как установить скилл act-local-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл act-local-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub