How do I run a single pipeline per branch/tag?

Run a single pipeline per branch/tag

In my project there are several branches and tags, for example the tags of “dev” and “staging”. These are used for the updating of remote environments of the same name. The pipeline jobs must be run in sequence and with a concurrency of 1. The pipeline must run to completion, either success or failure.

While I’m waiting for a job in one branch to complete, I may add additional changes and want to stage them for when the previous pipeline has completed. Or, a colleagues may also need to run a pipeline on the same environment. Both cases should be blocked to avoid mid-air collisions.

Is it possible to make a pipeline run with a concurrency of 1 per branch/tag?

How can I do this without modifying the runner concurrency of all jobs?