Which definition of a workflow triggers a workflow?

Which definition of a workflow triggers a workflow?

Let me define a workflow in my master branch to upload an artifact with every push to the master branch.

Now let me rebase all 100 branches in my repository on my master branch. Now I have 101 branches in my repository that contain the definition of a workflow that uploads an artifact with every push to master.

Am I now in the situation where a single push to master uploads 101 artifacts (each copy of the workflow in each branch is triggered to upload an artifact)?

1 Like

TL;DR: If you specified master in your trigger, you won’t be in this situation even when rebasing+pushing all your branches.

If you defined you workflow trigger like this, only the workflow defined on master will be triggered, after any push on master ( and master only ). e.g.: when merging a branch into master.

on:push:branches:-master

If you defined you workflow trigger like this, the workflow defined on the branch that was just pushed to will be triggered:

on: push

The only way to trigger every workflows of every branches, in this last example, would be to push on all branches at the same time, e.g.: after rebasing all branches on master and pushing them all. It will not be the case if you defined it like in the first example.

1 Like