Skip to content

Commit

Permalink
docs: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Yu authored and Shawn Yu committed May 14, 2024
1 parent 95c8c00 commit 5127022
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Trigger Github action runs, and open the action run in the browser.
* [Installation](#installation)
* [Setup](#setup)
* [Usage](#usage)
* [Achieved workflow](#achieved-workflow)
* [Achieved workflows](#achieved-workflows)
* [Commit + push](#commit--push)
* [Amend current commit + force push](#amend-current-commit--force-push)
* [Workflows with manual triggers](#workflows-with-manual-triggers)
Expand Down Expand Up @@ -53,32 +53,37 @@ Flags:
Use "ac [command] --help" for more information about a command.
```

## Achieved workflow
## Achieved workflows

This plugin allows the following workflow when developing Github actions:

### Commit + push

This is a typical git workflow you'd follow when developing actions
This is a typical git workflow you'd follow when developing a feature

1. Commit your local changes
2. Use `gh ac push` to push your changes, and select a workflow run to open in the browser
1. Commit your local changes using `git`
2. Run `gh ac push` to push your changes
3. Select the workflow run to open in the browser

### Amend current commit + force push

Sometimes, you'd want to make a very small change in a workflow, that does not constitute another commit called `testing`. You would like to just bundle your current changes with the previous commit:
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:

1. Stage the changes you would like to push, `git add my-file.txt`
1. Stage the changes you would like to push: `git add my-file.txt`
2. Use `gh ac force`, which will run `git commit --amend --no-edit && git push` under the hood, to add your current changes to the previous commit, and force push
3. 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.

### Workflows with manual triggers

For workflow with `workflow_dispatch` events, this plugin supports triggering a `workflow_dispatch` event, and opening the workflow in the browser.
For workflow with `workflow_dispatch` events, this plugin supports emitting a `workflow_dispatch` event, and opening the workflow in the browser.

1. Use `gh ac dispatch`, and select a workflow name to send a `workflow_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
2. To send workflow inputs, use `gh ac dispatch -w <workflow name> -f key=value` to pass form body

- Use `gh ac dispatch`, and select a workflow name to send a `workflow_dispatch` event to. It is the user's responsibility to select the workflow with `workflow_dispatch` trigger.
- 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`
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

Expand Down

0 comments on commit 5127022

Please sign in to comment.