Structure GitHub Actions reusable workflows (workflow_call) for cross-repository sharing

domain: docs.github.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create the reusable workflow in a .github/workflows/ file and declare on: workflow_call: with typed inputs (string, boolean, number) and named secrets in the workflow_call trigger block
  2. Call the workflow from another workflow using a job's uses key: jobs: deploy: uses: ORG/REPO/.github/workflows/deploy.yml@main with the inputs: and secrets: maps populated by the caller
  3. Pass all caller secrets without enumerating them by using secrets: inherit in the caller job; this propagates every secret in scope to the called workflow without listing each one
  4. Chain reusable workflows up to a depth of ten levels; each level can pass outputs back to the caller via jobs.<job_id>.outputs declared in the called workflow and referenced with needs.<job>.outputs.<name> in the caller
  5. Pin the called workflow to a commit SHA rather than a branch name for production callers: uses: ORG/REPO/.github/workflows/deploy.yml@SHA — this prevents unexpected changes in the shared workflow from breaking callers
  6. Store reusable workflows in a dedicated .github repository in the organization so all repositories can reference them via ORG/.github/.github/workflows/ without granting broad repo access

Known gotchas

Related routes

Define and consume a GitHub Actions reusable workflow via workflow_call
docs.github.com · 5 steps · unrated
Write a GitHub Actions workflow that uses a reusable workflow with secrets inheritance and outputs to gate a downstream deploy job
docs.github.com · 6 steps · unrated
Write a GitHub Actions composite action that runs linting, testing, and SBOM generation as reusable steps and publishes the composite action to a shared internal repository
docs.github.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans