https://github.com/ph-fritsche/action-dispatch
https://github.com/ph-fritsche/action-dispatch
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ph-fritsche/action-dispatch
- Owner: ph-fritsche
- License: mit
- Created: 2020-12-28T13:40:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-05T06:10:50.000Z (over 4 years ago)
- Last Synced: 2025-02-28T16:36:22.138Z (4 months ago)
- Language: JavaScript
- Size: 124 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/ph-fritsche/action-release/)
[](https://github.com/ph-fritsche/action-release/blob/master/.github/workflows/build.yml)# action-dispatch
Trigger `workflow_dispatch` and `repository_dispatch` events from a workflow.
This requires a personal access token with the `repo` scope.
## workflow_dispatch
```yml
// some-workflow.yml
jobs:
some-job:
- name: Dispatch workflow_dispatch event
uses: ph-fritsche/action-dispatch@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
ident: example-workflow.yml # refer to the filename
payload: '{"foo":"bar"}' # json
``````yml
// example-workflow.yml
on:
workflow_dispatch:
inputs:
foo:
description: Some input
required: true// ${{github.event.inputs.foo}} will be "bar"
```## repository_dispatch
```yml
// some-workflow.yml
jobs:
some-job:
- name: Dispatch repository_dispatch event
uses: ph-fritsche/action-dispatch@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
type: repository
ident: example-repository # refer to on.repository_dispatch.types.*
payload: '{"foo":"bar"}' # json
``````yml
// example-repository.yml
on:
repository_dispatch:
types: [example-repository] # the name here is referred to by the dispatch// ${{github.event.client_payload.foo}} will be bar
```