Skip to content
Latchkey

How to Call a Reusable Workflow From Another Repository in GitHub Actions

A cross-repo call uses the full owner/repo/.github/workflows/file.yml@ref path, so one repo can host shared pipelines.

Point uses: at the workflow in another repository. Access to private source repos is controlled by the repo's Actions settings for who may call its workflows.

Steps

  • Host the reusable workflow in a central repo (e.g. my-org/ci).
  • In each consumer, set uses: my-org/ci/.github/workflows/build.yml@ref.
  • For private central repos, allow access under Settings to Actions to Access.

Caller workflow

.github/workflows/ci.yml
jobs:
  build:
    uses: my-org/ci/.github/workflows/build.yml@v1
    with:
      environment: staging
    secrets: inherit

Gotchas

  • The @ref is required for cross-repo calls; a bare path is not allowed.
  • A private central repo must explicitly grant access to the calling repositories.

Related guides

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