Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Wat het doet
Changing a workflow and pushing again and again to see if it works is slow. act reads .github/workflows/*.yml and runs the jobs locally in Docker containers that look like the GitHub runners. You see errors in seconds.
Not everything is the same as on GitHub (for example OIDC to the cloud and some services), but builds, tests, linters and scripts work well.
Zo schrijf je het
act [EVENT] [OPTIONS]Opties 13
Meest gebruikt
Options
Niets past bij dit filter.
Voorbeelden 11
$ als gewone gebruiker# als root (of met sudo)
1List the jobs
act -l2Run the push workflows
act3Run one job of a pull request workflow
act pull_request -j test4Give a secret
act -s GITHUB_TOKEN="$(gh auth token)"5Secrets from a file (never commit it)
cat .secrets NPM_TOKEN=xxxx act --secret-file .secrets6Dry run
act -n7A bigger runner image (more tools inside)
act -P ubuntu-latest=catthehacker/ubuntu:full-latest8One matrix entry only
act -j test --matrix node:229A manual workflow with inputs
act workflow_dispatch --input environment=staging10A custom event payload (for example a tag push)
cat event.json { "ref": "refs/tags/v1.4.0" } act push -e event.json11On a Mac with Apple Silicon
act --container-architecture linux/amd64
Niets past bij dit filter.
Let op
- Add
.secretsand.varsto.gitignore. - Steps with
if: ${{ !env.ACT }}are a way to skip things that only work on GitHub. - The default small image misses many tools; jobs that pass locally can still fail on GitHub (and the other way).
Bestanden
.actrc- Default options (for example the runner images).
.secrets / .vars- Local secrets and variables.
Exitcodes
0 | All jobs passed. |
1 | A job failed. |