Skip to content

Fix schedule rules ordering

Brian Williams requested to merge bwill-master-patch-20663 into master

Why is this change being made?

!2568 (merged) was supposed to fix gitlab-org/gitlab#337366 (closed), but I made a blunder regarding the rules ordering.

According to the docs:

Rules are evaluated in order until the first match. When a match is found, the job is either included or excluded from the pipeline, depending on the configuration.

Since the positive conditions are met before $CI_PIPELINE_SOURCE == "schedule", the job is included despite the attempt to exclude scheduled jobs. Negative assertions need to go before any positive assertions to ensure that they are excluded.

Edited by Brian Williams

Merge request reports