Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ph-fritsche/action-dispatch
https://github.com/ph-fritsche/action-dispatch
Last synced: 24 days 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 (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-05T06:10:50.000Z (over 3 years ago)
- Last Synced: 2024-09-16T22:39:02.625Z (about 2 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
[![action-release](https://img.shields.io/static/v1?logo=github-actions&logoColor=cyan&label=%F0%9F%9A%80&message=action-release&color=cyan)](https://github.com/ph-fritsche/action-release/)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ph-fritsche/action-dispatch/Build?label=Build&logo=github-actions&logoColor=cyan)](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
```