Skip to content
Latchkey

How to Call a Reusable Workflow in GitHub Actions

You call a reusable workflow by setting uses: directly on a job, not on a step.

In the caller, define a job whose uses: points at the reusable workflow path plus a @ref. The job has no runs-on or steps; the called workflow supplies those.

Steps

  • Add a job in the caller workflow.
  • Set uses: owner/repo/.github/workflows/build.yml@ref on that job.
  • Do not add runs-on or steps; the reusable workflow owns them.

Caller workflow

.github/workflows/ci.yml
on: [push]
jobs:
  build:
    uses: my-org/ci/.github/workflows/build.yml@main
  test:
    needs: build
    uses: my-org/ci/.github/workflows/test.yml@main

Gotchas

  • A calling job cannot mix uses: with its own steps:; keep the two styles separate.
  • You can chain reusable-workflow jobs with needs: just like normal jobs.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →