mirror of
https://github.com/tschoffelen/gha.git
synced 2024-10-05 21:38:21 +03:00
🔧 Test your GitHub Actions workflow locally.
assets | ||
lib | ||
.gitignore | ||
.npmignore | ||
index.js | ||
package-lock.json | ||
package.json | ||
README.md |
GitHub Actions Tester
This Node application exposes an executable that allows you to test your GitHub workflow locally using Docker.
Installation
Install using NPM:
npm i -g gha
Other prerequisites:
- A local installation of Docker
- A repo with a
.github/main.workflow
file
Usage
Usage: gha [options]
Options:
-V, --version output the version number
-f <workflowfile> Set workflow file path, defaults to .github/main.workflow
-e <event> Set event, defaults to push
-h, --help output usage information
Development
This app currently only supports Github-hosted Dockerfiles (i.e. with the
{user}/{repo}@{ref}
or {user}/{repo}/{path}@{ref}
syntax), so we still need
to add:
- Add support for local Docker images:
./path/to/dir
- Add support for Docker Hub images:
docker://{image}:{tag}
- Add support for custom hosted Docker images:
docker://{host}/{image}:{tag}
Some improvements are also possible in other areas:
- Add support for secrets
- Add support for default
GITHUB_TOKEN
env var