Last active
October 9, 2024 14:38
-
-
Save ciiqr/31af63601a4b52a05133cf2c87e022e3 to your computer and use it in GitHub Desktop.
github actions, repository_dispatch with client_payload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: replace :token, :user, and :repo | |
curl -H "Authorization: token :token" \ | |
-H 'Accept: application/vnd.github.everest-preview+json' \ | |
"https://api.github.com/repos/:user/:repo/dispatches" \ | |
-d '{"event_type": "awesomeness", "client_payload": {"foo": "bar"}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: example-client-payload-action | |
on: repository_dispatch | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- run: 'echo "field: ${{ github.event.client_payload.foo }}"' | |
- run: 'echo "payload: ${{ toJson(github.event.client_payload) }}"' | |
- run: echo baz | |
if: github.event.action == 'baz' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Appreciate it