Member-only story
Github Reusable Workflows
A reusable workflow is a GitHub Actions file that can be executed by other workflows. A single workflow can call multiple reusable workflows, with each reference taking up just one line of YAML. This means that the “caller” workflow may contain just a few lines of YAML, but perform a large number of tasks, since it runs each “called” workflow entirely, as if its jobs and steps were part of its own.

What are the benefits of reusable workflows?
Reusable workflows offer several benefits:
- Avoid redundancy
- Speed up workflow creation through reuse
- Reduce maintenance and enhance security by offering a library of reusable workflows that can be centrally maintained
- Promote the use of workflows that are well-designed, already tested, and proven effective
The triggering event
For a workflow to be reusable, the values for on must include workflow_call
:
on:
workflow_call:
Input definition
You can define inputs and secrets in a reusable workflow to receive them from a caller workflow. Use the inputs
and secrets
keywords for this purpose. For more information, see our guide on securing CI/CD with secrets…