Romero Junior
Romero Junior

Reputation: 243

GitLab CI - Automated builds only on schedule

After a long search I couldn't find a way to do this, so now I wonder if it's possible to disable automated builds when a merge/push is done to master, allowing it to happen only based on a scheduled pipeline, so far I've tried:

when: manual

The above disables automated builds, but on scheduled builds it also expects a user input allowing it happen.

except: master

Also disables automated builds, even for scheduled pipelines (master branch)

Any tips?

Upvotes: 0

Views: 1217

Answers (1)

Lexx
Lexx

Reputation: 31

Use schedules keyword instead of branch name. Gitlab understands it for scheduled pipelines. Like:

job:
  ..........
  only:
    - schedules

Doc: https://docs.gitlab.com/ee/ci/yaml/#only-and-except-simplified

Upvotes: 1

Related Questions