Skip to content

Repository_dispatch client_payload JSON with arrays #25604

Repository_dispatch client_payload JSON with arrays #25604
Sep 22, 2021 · 1 answer

I am using the on: repository_dispatch event and looking to send a custom JSON payload which will contain an array like:

{"event_type": "update-helm-image-tags", "client_payload": { "applications": ["server", "worker"], "environments": ["dev", "stage"], "image_tag": "${{ env.DOCKER_IMAGE_TAG }}" }}

How in the GitHub action itself can I grab the entire array values of github.event.client_payload.applications? Currently this value is literally the string Array. I am looking for it to be exploded into a string separated by commas.

github.event.client_payload.applications = Array

Solution is to use the built-in function:

join(github.event.client_payload.applications, ',')

Replies

1 suggested answer

Solution is to use the built-in function:

join(github.event.client_payload.applications, ',')
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant