convictional / trigger-workflow-and-wait

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

Unexpected inputs provided when providing client_payload #53

Closed JakubGniadzik closed 1 year ago

JakubGniadzik commented 2 years ago

Hello! I've issue when I try to pass client payload using trigger-workflow-and-wait:

curl: (22) The requested URL returned error: 422 api failed: path: workflows/workflow.yml/dispatches response: { "message": "Unexpected inputs provided: [\"remote_repo\"]", "documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event" }

According to README I should use JSON syntax in client_payload and this is what I'm using: client_payload: '{"remote_repo": "${{ github.event.repository.name }}"}'

Thanks in advance for help!

anitakrueger commented 2 years ago

I'm running into the same issue. I'm pretty sure it is because this action triggers a workflow_dispatch not a repository_dispatch which has client_payload as its input.

JakubGniadzik commented 2 years ago

workflow_dispatch have "inputs" parameter in API request https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event and this action is using that parameter, client_paylaod is just a variable, which is used here to provide inputs https://github.com/convictional/trigger-workflow-and-wait/blob/a382075b8ce6e15d85477232d501eb047e21f7aa/entrypoint.sh#L138 So I guess this is not an issue that we are looking for...

JakubGniadzik commented 2 years ago

Actually when I look on this line now - I think escape characters are missing here for clinet_payload variable, maybe this cause the problem?

JakubGniadzik commented 2 years ago

@keithconvictional could you take a look on that?

keithconvictional commented 2 years ago

@rabih

rabih commented 2 years ago

According to README I should use JSON syntax in client_payload and this is what I'm using: client_payload: '{"remote_repo": "${{ github.event.repository.name }}"}'

Thank you for the patience @JakubGniadzik! Can you confirm that "remote_repo" exists as an input in whatever workflow you are trying to trigger. I was able to recreate the situation and can confirm that it is working properly for me.

rabih commented 1 year ago

Closing due to inactivity