Support-question: Run Job manual or on_success depending on branchname in gitlab-ci.yml

Is there a way to set the "when" statement dynamically depending on the branchname? Something like that:

Integration:
  stage: Deploy Artifact
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - src/main/frontend/node/
    policy: pull
  except:
    - master
    - /^release\/.*$/
    - tags
  when: $([ $CI_COMMIT_REF_NAME = develop ] && "on_success" || "manual")

Tried the approach with:

  • variables (like example or with extracted variables)
  • special yaml features (<<, &, *)

Any other ideas?

Edited Jul 23, 2018 by Marcel Tinner
Assignee Loading
Time tracking Loading