Can GitHub Actions use a central repository for shared pipelines?

November 15, 2026 4 answers
Asked by Rellvik.3u

I'm moving from GitLab CI to GitHub Actions. Can project repositories reference pipelines from a central repository instead of each maintaining their own copy?

Answers

6e~circuitladle_294

Yes. Reusable workflows are the closest match. Put a workflow in the central repository's .github/workflows directory and configure it with the workflow_call trigger. Each project keeps a small workflow that defines its triggers and calls the shared workflow as a job using the repository, workflow path, and a branch or tag ref.

Define inputs on the shared workflow for project-specific settings. It isn't quite the same as including YAML, but it gives you a central, versioned place to maintain whole jobs or pipelines.

Rellvik.3u:

That sounds like the mapping I was looking for. So the project still needs its own workflow file to decide when to run?

3c!sparecircuit_618:

Yes. The caller defines its triggers and calls the reusable workflow. The shared workflow uses workflow_call so it can be invoked that way.

Reply to this answer
Jelvor.7c

Also look at composite actions for reuse at the step level. A reusable workflow is useful when you want to share jobs, while a composite action bundles steps that run inside a caller's job.

For example, you could keep tagging or artifact publishing logic in actions, then combine those pieces in a broader build workflow. That gives teams a way to reuse smaller parts without adopting the entire pipeline.

Reply to this answer
3n~ferrulebasket_417

Watch the boundaries between workflows and jobs. Environment variables from the caller's workflow-level env don't automatically carry into a called workflow. Pass configuration as inputs, and use outputs with job dependencies when a later job needs a value produced by an earlier one.

Secrets need deliberate handling too. You can pass named secrets to the called workflow, or use secrets: inherit where that's supported and appropriate. Don't assume every caller variable and secret just comes along for the ride.

q314!buskey_6:

A composite action can be handy when the shared logic needs to run as steps within the caller's job rather than across a workflow boundary.

Reply to this answer
5y~tagdrawer_208

Think about permissions before putting every shared workflow in one repository. Workflows that need write access, such as publishing or tagging jobs, may be worth separating from less privileged build logic so access to the sensitive code can be managed more carefully.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions