I found act
tool that aims to do just that: https://github.com/nektos/act
Install
There are multiple options to install it, but I chose to use it as a GitHub CLI extension:
After that the gh act
command is available in the terminal.
How to run a specific workflow
To list all available jobs:
gh act -l
The output can be something like:
To run specific job:
gh act push -j apply -n
where:
push
- a name of the event,-j apply
- run the job with idapply
,-n
- dry run.
How to pass secrets
gh act -s MY_SECRET=somevalue
gh act -s MY_SECRET
- check for an environment variable namedMY_SECRET
and use it if it exists. If the environment variable is not defined, prompt the user for a value.gh act --secret-file my.secrets
load secrets frommy.secrets
file
===Couldn’t proceed with this. Some quirks with vars
were present.===