I have a workflow build
whose output is store in a docker registry,
depending on its outcome, then, I would like to run a e2e test
.
I know I can use workflow_run
but it's not clear how to pass outputs to the dependant workflow.
on:
workflow_run:
workflows: ["Build"]
types: [completed]
I should be able to grab the IMAGE_URL
output and run tests on that specific artefact.
- how can I set a workflow output
- how can I read a workflow output
Current workaround is using workflow_dispatch
, but it has the drawback of not being listed as PR check.
You can write your variables and values, which you want to pass, to a file and upload it as an artifact in the triggering workflow.
In the triggered workflow, download the artifact of the triggering workflow run. Then parse the file to get your variables.
Triggering workflow
Triggered workflow
(artifacts from other workflows can't be downloaded with the action
download-artifact
)