[feature] add a fallback branch for trigger pipelines
Description of the problem
Hello, I'm currently experimenting with trigger jobs, and I'd like to know if there's a way to do the following:
When I push a change on
repo-A, I want to trigger a pipeline on
repo-B, with the same branch on both repos if such a branch exists, and to fallback on another branch if not (the default one?).
- change is pushed on
repo-Bdoes not have such a branch, falls back to
The rationale is that the trigger job is stuck as pending when the branch does not exist (there are some opened issues about it already, and PRs related to error propagation).
There are multiple ways to provide this feature in the
.gitlab-ci.yml, here is a first thought:
stages: - trigger bridge_job: stage: trigger trigger: project: repo-B branches: ["$CI_COMMIT_BRANCH", master]