The GitHub Action Local Executor, or gale
for short, is a powerful tool that enables the execution of
GitHub Actions locally using Dagger.
Warning: This project is still in early development and is not ready for use.
Warning: This project currently relies on gh
for authentication. The github cli must be installed and authenticated.
- Execute GitHub Actions locally
- Test and Debug GitHub Actions locally without pushing to GitHub
- List previous runs of a workflow and access their logs, artifacts, and metadata
- Support for
custom
actions usingnode
- Support for
bash
scripts inrun
steps - Support for
docker://
actions - Support for github expressions, e.g.
${{ github.ref }}
- Support for
secrets
- Support for triggers and events
- Support for
composite
actions - Support for reusable workflows
- Add Default environment variables
**including list from aweris/ghx as well
go get github.com/aweris/gale
Usage:
Usage:
gale [flags]
Flags:
--export Export the runner directory after the execution. Exported directory will be placed under .gale directory in the current directory.
-h, --help help for gale
--job string Name of the job
--workflow string Name of the workflow. If workflow doesn't have name, than it must be relative path to the workflow file
Run:
gale --workflow=.github/workflows/clone.yaml --job=clone --export
The above command will execute the clone
job in the workflow .github/workflows/clone.yaml
and export the runner directory to .gale/<timestamp>
directory.
result, err := gale.New(client).
WithGithubContext(githubCtx).
WithJob(".github/workflows/clone.yaml", "clone").
WithStep(&model.Step{ID: "0", Uses: "actions/checkout@v3", With: map[string]string{"token": jrc.Github.Token}}, true). // override checkout step
Exec(ctx)
The above code will will do same thing as the CLI command above with one difference. It will override the checkout step with the one provided in the WithStep
method.