Skip to content

Instantly share code, notes, and snippets.

@ciiqr
Last active May 3, 2024 19:47
Show Gist options
  • Star 60 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save ciiqr/31af63601a4b52a05133cf2c87e022e3 to your computer and use it in GitHub Desktop.
Save ciiqr/31af63601a4b52a05133cf2c87e022e3 to your computer and use it in GitHub Desktop.
github actions, repository_dispatch with client_payload
# 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"}}'
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'
@rmariuzzo
Copy link

Thank you!

@SashaGolovach
Copy link

Thanks!

@jhon0010
Copy link

jhon0010 commented Nov 4, 2020

Thank you, very nice ! 👍

@happy-day-by-day
Copy link

Thanks!

@dregenor
Copy link

thanks

@nichol-fluke
Copy link

This saved me hours, thank you!

@trathailoi
Copy link

So nice!! Thank you! 👍 👍 👍

@ZeWaka
Copy link

ZeWaka commented Jul 9, 2021

Many thanks!

@v-stickykeys
Copy link

👍

@iandone
Copy link

iandone commented Sep 14, 2021

Thank you!

@elip-OE
Copy link

elip-OE commented Nov 5, 2021

Thanks!

@vegassor
Copy link

Thanks!

@tokisakiyuu
Copy link

Thanks!

@Ajaypathak372
Copy link

I want to send an input parameter with repository_dispatch, is it possible to do so?

@kopax-polyconseil
Copy link

client_payload ?

@ahmed2m
Copy link

ahmed2m commented Dec 7, 2022

This is awesome! Thank you!
I added a python equivalent in my fork.

@SoftwarehouseForAutomation

i needed the github action workflow to get info from Jira webhook, sent to github, thanks!

@asarenkansah
Copy link

Appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment