Skip to main content
In this guide, you’ll learn how to expose and consume outputs from a reusable GitHub Actions workflow. By defining outputs under workflow_call and mapping job outputs, downstream jobs can reference values—such as your application’s ingress URL—without extra scripting.

Background

Our dev-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:
  1. Declaring outputs in the reusable workflow.
  2. Mapping those outputs from a job step.
  3. 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 referenced APP_INGRESS_URL before the change:
Since 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 new application-url output:

4. Testing the Changes

Once you commit these updates:
Your logs should resemble:
Now both integration-testing jobs will successfully read the ingress URL from the reusable workflow.

Watch Video

Practice Lab