Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdb/gh-dispatch
A gh CLI extension for sending GitHub dispatch events and watching the triggered GitHub Actions runs directly from your terminal.
https://github.com/mdb/gh-dispatch
cli gh-extension go golang terminal
Last synced: about 2 months ago
JSON representation
A gh CLI extension for sending GitHub dispatch events and watching the triggered GitHub Actions runs directly from your terminal.
- Host: GitHub
- URL: https://github.com/mdb/gh-dispatch
- Owner: mdb
- License: mit
- Created: 2022-10-21T17:19:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T16:26:03.000Z (almost 2 years ago)
- Last Synced: 2024-11-13T13:54:07.388Z (about 2 months ago)
- Topics: cli, gh-extension, go, golang, terminal
- Language: Go
- Homepage:
- Size: 12.2 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CI/CD](https://github.com/mdb/gh-dispatch/actions/workflows/cicd.yaml/badge.svg)](https://github.com/mdb/gh-dispatch/actions/workflows/cicd.yaml)
# gh-dispatch
A [gh CLI](https://cli.github.com/) extension for triggering [repository_dispatch](https://docs.github.com/en/rest/repos/repos#create-a-repository-dispatch-event) and/or
[workflow_dispatch](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) events and watching the resulting GitHub Actions
workflow run.![demo](demo.gif)
## Usage
Trigger a repository dispatch event and watch the resulting GitHub Actions run from your terminal:
```
gh dispatch repository \
--repo "mdb/gh-dispatch" \
--workflow "Hello" \
--event-type "hello" \
--client-payload '{"name": "mike"}'
```Trigger a workflow dispatch event and watch the resulting GitHub Actions run from your terminal:
```
gh dispatch workflow \
--repo "mdb/gh-dispatch" \
--workflow "workflow_dispatch.yaml" \
--inputs '{"name": "mike"}'
```## Installation
Install the `gh` CLI [for your platform](https://github.com/cli/cli#installation). For example, on Mac OS:
```
brew install gh
```Install the latest `dispatch` extension from [its releases](https://github.com/mdb/gh-dispatch/releases):
```
gh extension install mdb/gh-dispatch
```## Development
Build and test `gh-dispatch` locally:
```
make
```Install a locally built `gh-dispatch` for use as `gh dispatch`:
```
make install
```Run acceptance tests against a local `gh-dispatch` installation, verifying the local `gh-dispatch` is able to trigger dispatch events and render the expected output:
```
make acc-test
```