Linux command
act 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run
act
List
act -l
Example
act -W [.github/workflows/ci.yml]
Example
act -j [build]
Example
act --secret-file [.secrets]
Dry run
act -n
Example
act -P ubuntu-latest=catthehacker/ubuntu:act-latest
说明
act allows you to run GitHub Actions workflows locally using Docker containers. It parses workflow YAML files and executes jobs in containers that simulate the GitHub Actions environment, enabling rapid iteration and debugging without pushing to GitHub. The tool supports most GitHub Actions features including matrix builds, secrets, environment variables, and artifacts. It downloads and caches action repositories automatically.
参数
- -W _file_, --workflows _file_
- Path to workflow file(s) (default: .github/workflows/)
- -j _job_, --job _job_
- Run a specific job
- -e _file_, --eventpath _file_
- Path to event JSON file
- --secret-file _file_
- Load secrets from file (KEY=VALUE format)
- -s _secret_, --secret _secret_
- Set a secret (KEY=VALUE)
- --env-file _file_
- Load environment variables from file
- -P _platform_, --platform _platform_
- Custom Docker image for platform (e.g., ubuntu-latest=catthehacker/ubuntu:act-latest)
- --input _input_
- Set a workflow input (KEY=VALUE)
- --input-file _file_
- Load workflow inputs from file
- --matrix _matrix_
- Select specific matrix configuration to run
- --action-offline-mode
- Don't pull images or fetch remote actions if already cached
- -l, --list
- List available workflows and jobs
- -n, --dryrun
- Show what would be run without executing
- -r, --reuse
- Reuse containers between runs
- -b, --bind
- Bind working directory instead of copying
- --container-architecture _arch_
- Container architecture (amd64, arm64)
FAQ
What is the act command used for?
act allows you to run GitHub Actions workflows locally using Docker containers. It parses workflow YAML files and executes jobs in containers that simulate the GitHub Actions environment, enabling rapid iteration and debugging without pushing to GitHub. The tool supports most GitHub Actions features including matrix builds, secrets, environment variables, and artifacts. It downloads and caches action repositories automatically.
How do I run a basic act example?
Run `act` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -W _file_, --workflows _file_ do in act?
Path to workflow file(s) (default: .github/workflows/)