Allan Xu
Allan Xu

Reputation: 9288

What happens if I have two versions of a workflow.yaml in main (master) and another branch?

I have workflow1.yml in my main (master) brach.

I have an updated version of the workflow.yaml. file in two another branches (3 version of the file in total)

Is there any way to define which branch is the source of workflow1.yml so runner run the code from a diffrent brach instead of the one in the master brach?

Upvotes: 1

Views: 331

Answers (1)

VonC
VonC

Reputation: 1323115

The workflow yml file which is run will be the one found in the commit triggering the event.

See "Example using multiple events with activity types or configuration"

The .github/workflows directory in your repository is searched for workflow files at the associated commit SHA or Git ref. The workflow files must be present in that commit SHA or Git ref to be considered.

For example, if the event occurred on a particular repository branch, then the workflow files must be present in the repository on that branch.

So if an event occurs on a particular branch, the workflow.yaml present in that branch will run.

Upvotes: 1

Related Questions