Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henrywhitaker3/trigger-external-workflow-action
https://github.com/henrywhitaker3/trigger-external-workflow-action
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/henrywhitaker3/trigger-external-workflow-action
- Owner: henrywhitaker3
- License: mit
- Created: 2024-01-23T11:57:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-05-27T01:26:22.000Z (8 months ago)
- Last Synced: 2024-05-28T14:12:07.461Z (8 months ago)
- Language: TypeScript
- Size: 3.37 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trigger remote action
A GitHub action to trigger actions in another repository.
## Usage
### Remote workflow
Setup a new workflow in the target repository [(example)](https://github.com/henrywhitaker3/trigger-external-workflow-action/blob/main/.github/workflows/example-receiver.yml):
```yaml
name: Example Receiveron:
repository_dispatch:
types: [some_event]jobs:
some_event:
runs-on: ubuntu-lateststeps:
- name: Some event
run: |
echo some_event trigger received
echo ${{ github.event.client_payload.foo }}
```### Triggering the workflow
Then use this action to trigger that workflow from another repo:
```yaml
name: Example triggeron:
push:
branches:
- mainjobs:
some_event:
runs-on: ubuntu-lateststeps:
- uses: henrywhitaker3/trigger-external-workflow-action@v1
with:
# You need to setup a PAT for this, as secrets.GITHUB_TOKEN
# is repo-scoped and won't work
token: ${{ secrets.TRIGGER_TOKEN }}
# Replace with your repo
repo: henrywhitaker3/trigger-external-workflow-action
# Replace with your event name
event: some_event
# Add your own JSON and access it in the target workflow with
# ${{ github.event.client_payload. }}
payload: '{"foo": "bar"}'
```