convictional / trigger-workflow-and-wait

Trigger a workflow in another (or same) repository and wait for the job to finish.
MIT License
321 stars 153 forks source link

Add client_payload #2

Closed jbuettnerbild closed 3 years ago

jbuettnerbild commented 3 years ago

Please add the client_payload to the dispatch event. I think that is very simple. Everything to do is to add a new parameter here https://github.com/convictional/trigger-workflow-and-wait/blob/1b91bfd1001ab3deb961b6e36d261da5877c4410/entrypoint.sh#L62

Docu: https://developer.github.com/v3/repos/#create-a-repository-dispatch-event

I need the payload in a triggered workflow to receive more information of the called job.

jbuettnerbild commented 3 years ago

Hi, i implemented it on my fork. If you can give me write access i can make a pull request with the changes.

jbuettnerbild commented 3 years ago

client_payload=$(echo '{}' | jq) if [ "$INPUT_CLIENT_PAYLOAD" ] then client_payload=$(echo $INPUT_CLIENT_PAYLOAD | jq) fi

jbuettnerbild commented 3 years ago

@keithweaver 👋

keithconvictional commented 3 years ago

Thanks for submitting this. I'll do some investigation today. I can't see your fork but I see the code above.

jbuettnerbild commented 3 years ago

here is my fork: https://github.com/jbuettnerbild/trigger-workflow-and-wait

i also have update the wait-for-mechanisms. instead of watching for job id i check the workflow id. that is necessary if the workflow contains of many jobs. otherwise if the fist job finish the result of the other jobs are no longer taken into account.

keithconvictional commented 3 years ago

Thanks for the PR, @jbuettnerbild. It has been merged and is included in v1.2.0 (https://github.com/convictional/trigger-workflow-and-wait/releases/tag/v1.2.0). I'm going to close this now.