workflow_call and mapping job outputs, downstream jobs can reference values—such as your application’s ingress URL—without extra scripting.
Background
Ourdev-integration-testing job was failing because it tried to read an application URL that wasn’t exposed by the reusable workflow. Although dev-integration-testing depends on dev-deploy, by default reusable-workflow outputs are not forwarded to the caller. We’ll fix this by:
- Declaring outputs in the reusable workflow.
- Mapping those outputs from a job step.
- Consuming the mapped outputs in the caller workflow.
If you don’t define
outputs in workflow_call, any values you set inside the workflow won’t be available to the caller.1. Defining Outputs in Your Reusable Workflow
First, update your reusable workflow (reuse-deployment.yml) to include an outputs block under on.workflow_call. Then map job-level outputs to that workflow output:
Inputs and Secrets Reference
We use
${{ jobs.reuse-deploy.outputs.APP_INGRESS_URL }} to map the job’s output to the workflow’s application-url.2. Original Caller Workflow (Before)
Here’s how the caller workflow referencedAPP_INGRESS_URL before the change:
APP_INGRESS_URL wasn’t declared in the reusable workflow’s outputs, dev-integration-testing failed.
3. Consuming Outputs in the Caller Workflow
Update your caller workflow to use the newapplication-url output: