Trigger Github action runs, and open the action run in the browser.
gh extension install https://github.com/shawnyu5/gh-ac
This extension uses the $BROWSER
environment variable to determine the browser to use. Add the following to your bashrc
/ zshrc
export BROWSER="path/to/browser"
Fire off Github action workflow runs, and open it in the browser
Usage:
ac [command]
Available Commands:
cleanup Clean up workflow run history for a specific workflow
config Set config values
dispatch Create a workflow dispatch event, and open the workflow in the browser
force Force push to the current branch to trigger a workflow run, and open it in the browser
help Help about any command
push Push current changes and open the workflow run in browser
Flags:
--debug toggle debug logging
-h, --help help for ac
Use "ac [command] --help" for more information about a command.
This plugin allows the following workflow when developing Github actions:
This is a typical git workflow you'd follow when developing a feature
- Commit your local changes using
git
- Run
gh ac push
to push your changes - Select the workflow run to open in the browser
Sometimes, you'd want to make a very small change in a workflow, that does not constitute making another commit. You would like to just bundle your current changes with the previous commit:
- Stage the changes you would like to push:
git add my-file.txt
- Use
gh ac force
, which will rungit commit --amend --no-edit && git push
under the hood, to add your current changes to the previous commit, and force push - Select the workflow run to open in the browser
NOTE all git commands assumes you have set the default branch to push to. If it is not set, run git push -u origin <branch name>
prior to running this CLI.
For workflow with workflow_dispatch
events, this plugin supports emitting a workflow_dispatch
event, and opening the workflow in the browser.
- Use
gh ac dispatch
, and select a workflow name to send aworkflow_dispatch
event
- It is the user's responsibility to select the workflow with
workflow_dispatch
trigger. This plugin is not aware of the underlying workflow triggers
- To send workflow inputs, use
gh ac dispatch -w <workflow name> -f key=value
to pass form body
To run the workflow on a different branch, pass the --ref <github ref>
flag to use the workflow defined at the specific ref
All above commands supports the -w
flag, that allows passing the target workflow name as an argument, rather than being prompted for it on every run
Check in Github if the workflow is disabled. This CLI will not be able to find disabled workflows.
Or
If the repo is a forked repo, then you must set the default repo using gh repo set-default
.