From 51270227c404d11c03a1fe4d0dc7183e8398f968 Mon Sep 17 00:00:00 2001 From: Shawn Yu Date: Tue, 14 May 2024 13:32:59 -0400 Subject: [PATCH] docs: clean up --- README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7692f53..4bf74ac 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 ` 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 -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 -f key=value` to pass form body -- To run the workflow on a different branch, pass the `--ref ` flag to use the workflow defined at the specific `ref` +To run the workflow on a different branch, pass the `--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