act pull_request -W .github/workflows/my-workflow.yml
act push -W .github/workflows/my-workflow.yml
act tags -W .github/workflows/my-workflow.yml
Use a different event file
act pull_request -W .github/workflows/my-workflow.yml -e .actrc.event-1.json
Put these files in the project's root folder, or wherever act
will be ran from.
# Load event payload from file
-e .actrc.event.json
# Load workflow inputs from file
--input-file .actrc.inputs
# Load secrets and environment variables from file
--var-file .actrc.vars
--secret-file .actrc.secrets
# Cache used Actions
--action-offline-mode
# Run as AMD64 if on ARM64
--container-architecture linux/amd64
VAR1=(...)
VAR2=(...)
GITHUB_TOKEN=(...)
{
"inputs": {
"var-1": "Hello",
"var-2": "World"
}
}
Typical content for .actrc.event.json
.
{
"ref": "refs/heads/my-feature"
}
{
"base_ref": "refs/heads/main",
"ref": "refs/tags/v1.0.0"
}
{
"base_ref": "refs/heads/main",
"ref": "refs/pull/123/merge"
}
ref: https://nektosact.com/usage/runners.html#runners
Generally the medimum size is good. However, there are some advanced workflows that require the large image.
# Large
docker pull act -P ubuntu-latest=-self-hosted
# Medium
docker pull catthehacker/ubuntu:act-latest
act -P ubuntu-latest=catthehacker/ubuntu:full-latest
ref: https://nektosact.com/usage/index.html#configuration-file
When act runs it will load command arguments from the following locations
~/.config/act/actrc
~/.actrc
<current-folder>/.actrc
Any of the CLI flags can be added to the file. It just appends them when being ran.
act push --container-architecture linux/amd64
act -P ubuntu-latest=-self-hosted
act -P windows-latest=-self-hosted
act -P macos-latest=-self-hosted
ref: https://nektosact.com/usage/index.html#action-offline-mode
act --action-offline-mode
act --actor chriswblake
act | grep -v '::'