Introduction to Reusable Workflows - Blogs
X
02May

Introduction to Reusable Workflows

A reusable workflow is a pre-defined GitHub Actions workflow that can be called from another workflow. Reusable workflows make it easy to treat a workflow like an Action. It can be referenced and executed from other workflows in the caller’s context. This allows teams to share common workflow patterns, to centralize best practices, and to centralize the development of processes.

Reusable workflows listen for a special event, workflow_call. The workflow must be in the .github/workflows folder to be triggered. The workflow can also receive inputs.

Benefits of using reusable workflows:

  • Duplication is minimized by reusing workflows. This makes workflows easier to maintain and allows you to easily develop new workflows by building on the work of others, much like you do with actions.
  • You can reuse workflows rather than copying and pasting them from one to the next. The reusable process can then be called from another workflow by you or anybody with access to it.
  • Reusing workflows reduces redundancy and allows you to create a library of reusable workflows that can be maintained inside your company.

Creating Reusable workflow from GitHub Actions:

  • Reusable workflows are the same as ordinary GitHub Actions workflows, except that they must be triggered by a single special event called workflow call before they may be used as reusable workflows.

       workflow_call

  • The keyword uses can then be added to this workflow and it can be used in other workflows.

uses

  • To have access to reusable workflows within your organization. Simply go to Actions in your settings and select Allow all actions and reusable workflows in your organization.

 

reusable

 

Example of Reusable workflow using in another workflow:

The below workflow is the reusable workflow with name - Workflow-A.yml

 

Workflow-A

 

Below is the workflow calling reusable workflow with name - workflow-B.yml.

 

workflow-B

 

Limitations with reusable workflows:

  • If you have a reusable workflow in a private repository, it can only be used by other workflows in the same private repository.
  • A reusable workflow can only call another reusable workflow, but it can't reference more than once.
  • If reusable workflows are stored in a public repository, your organization may only use them in that repository.
  • Reusable workflows can't call other reusable workflows.

Related

Displaying Postscript text and Vector images on PDF in C#.net using Imageglue

Postscript is a language used for creating vector Images,Vector images are made up of many scalable ...

Read More >

Bulk Export Import Test Cases to Azure DevOps Test Plans using CSV file

As a user of Azure DevOps Test Plans or TFS Test Management for manual testing, from a long time eve...

Read More >

Deploy .NET application on IIS using GitHub actions

In this blog I will be showing how to deploy a .net application on IIS server (self-hosted runner). ...

Read More >

Protect and discover secrets using Git-leaks

Git-leaks is a SAST tool for detecting and preventing hardcoded secrets like Passwords, API keys, an...

Read More >

Identifying Web Elements using Selenium Webdriver

What is Web Element?             &n...

Read More >

Bugzilla to TFS Migrator (Part 2 of 4) – Installation

This is the second part of the Bugzilla to TFS Migrator blog series covering the installation of the...

Read More >

Google Closure

IntroductionClosure is a collection of tools for building rich web applications in JavaScript.Google...

Read More >

Authorize access to VSTS REST APIs with OAuth 2.0

Visual Studio Team Services uses the OAuth 2.0 protocol to authorize your app for a user and generat...

Read More >

TFS Build for .Net 2.0 Projects

Clients have strange requirements. The other day I had been to a client for a discussion. These guys...

Read More >

Dynamics 365 Business Central: How to Record Events in Business Central

When you are developing an extension for Dynamics 365 Business Central and you need to interact with...

Read More >

Share

Try DevOpSmartBoard Ultimate complete Azure DevOps End-to end reporting tool

Sign Up

  • Recent
  • Popular
  • Tag
Monthly Archive
Subscribe
Name

Text/HTML
Contact Us
  • *
  • *