How to define a pipeline that runs automatically on selected branches and can be run manually on any branch


#1

I’ve setup the following yml file that runs my pipeline automatically on master and development branches.
When I try to run a pipeline manually for any other branch, there is an error that no jobs exist for that branch.
How can I make a pipeline that runs automatically on master and development, but I can run it manually on other branches?

stages:
    - build

build:
    stage: build
    only:
        - master
        - development
    script:
        - .\Tools\python3\python.exe .\Tools\UnityBuildSystem\AutoBuild.py
    artifacts:
        paths:
            - .\Build\*

#2

I just made another stage that runs manually and doesn’t run on master and development

buildManual:
    stage: buildManual
    except:
        - master
        - development
    when: manual
    script:
        - .\Tools\python3\python.exe .\Tools\UnityBuildSystem\AutoBuild.py
    artifacts:
        paths:
            - .\Build\*