Mark job as manual only for MRs

I have this (simplified) configuration:

    - test
    - deploy

run unit tests:
    stage: test
        - ./fl test

deploy beta build:
    stage: deploy
        - ./fl deploy
    when: manual
    allow_failure: false

And I want for the deploy beta build job to be run manually when started from a MR, and automatically when started on the default branch.

Adding the rules attribute to the deploy job makes it run completely separate, in a different pipeline. Which is not what I want. Adding the workflow:rules attribute makes the pipeline run only on a MR, which is again not what I want.

  • GitLab (Hint: /help): GitLab Enterprise Edition 13.5.0-pre