Better Programming

Advice for programmers.

Member-only story

A Deep Dive into GitHub Actions’ Reusable Workflows

Wenqi Glantz
Better Programming
Published in
5 min readAug 5, 2022

--

Montana landscape. Photo by author

GitHub actions reusable workflow was released for general availability on November 29, 2021, and it’s been gaining rapid popularity since. The benefits of reusable workflows are pretty straightforward:

  • Follows DRY (Don’t Repeat Yourself) principle
  • Avoids workflow duplication
  • Easier to maintain the workflows
  • Allows us to create new workflows more quickly by building on the work of others.
  • Promotes best practices by using workflows that are well designed and have already been tested.

According to an observation from Thoughtworks’ Technology Radar,

“Reusable workflows in GitHub Actions bring modularity to pipeline design, allowing parameterized reuse even across repositories (as long as the workflow repository is public [or private]). They support the explicit passing of confidential values as secrets and can pass outputs to the calling job.

With a few lines of YAML, GitHub Actions now gives you the type of flexibility you see with CircleCI Orbs or Azure Pipeline Templates, but without having to leave GitHub as a platform.”

--

--