Add 'payload' field to allow for Repository Dispatch#341
Add 'payload' field to allow for Repository Dispatch#341peckjon wants to merge 12 commits intoactions:mainfrom
Conversation
Update from parent
|
Hey Jon! We would welcome this addition! Do you mind adding some tests? I'll leave you some comments on the documentation |
omerbensaadon
left a comment
There was a problem hiding this comment.
Requested a few changes docs-wise and adding some tests wouldn't hurt!
Co-authored-by: Omer Bensaadon <omerbensaadon@github.com>
|
Thanks @omerbensaadon ! Changes to README completed. I'm not aware of a way to add a test using Repository Dispatch, since it takes flow control away from the current environment 😞 |
| } | ||
|
|
||
| export async function addToProject(): Promise<void> { | ||
| const payload = core.getInput('payload') ? JSON.parse(core.getInput('payload')) : github.context.payload |
There was a problem hiding this comment.
| const payload = core.getInput('payload') ? JSON.parse(core.getInput('payload')) : github.context.payload | |
| const inputPayload = core.getInput('payload') | |
| cont payload = inputPayload ? JSON.parse(inputPayload) : github.context.payload |
For the test here, I think it's ok to just test that side of the workflow changes. Particularly we might add a new test that calls a sample of other input mocks is here: add-to-project/__tests__/add-to-project.test.ts Lines 14 to 17 in ce05fa3 that should at least validate that the code accepts a payload as input |
|
is this going to be merged? This feature is a must for |
actions/upload-artifact v3 is end-of-life
Currently, actions/add-to-project cannot be used via repository_dispatch (or workflow_dispatch) since it retrieves all event-related information from the immediate github context, which is distinct from the dispatching workflow context.
This PR adds the ability to pass relevant context information from a dispatching workflow to a target workflow, and provides relevant documentation & code samples.