Skip to content
Latchkey

GitLab "workflow:rules" Blocks Every Pipeline - No Pipeline Created

workflow:rules is the top-level gate that decides whether a pipeline is created at all. If no rule matches the current event, GitLab silently creates nothing - no error, just an absent pipeline.

What this error means

A push or MR produces no pipeline whatsoever, and there is no "invalid configuration" banner. The MR shows no pipeline widget, and the pipelines list has no new entry for the ref.

Pipeline Editor / CI lint
# Pushed to a feature branch, but Pipelines shows nothing new.
# CI lint: "Pipeline will not run for the provided ref"
workflow:
  rules:
    - if: '$CI_COMMIT_BRANCH == "main"'   # only main ever matches

Common causes

No workflow rule matches the event

When workflow:rules is present, a pipeline is created only if a rule matches. If every rule is scoped to one branch or one source, all other events fall through to an implicit when: never.

A leading rule has when: never

An early catch-all like if: '$CI_COMMIT_BRANCH' when: never short-circuits before any later allow rule, so nothing is created.

How to fix it

Add a permissive final rule

End workflow:rules with a fallback that allows the events you expect, so normal pushes still create a pipeline.

.gitlab-ci.yml
workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_COMMIT_TAG'
    - if: '$CI_COMMIT_BRANCH'   # fallback: any branch push

Preview against the actual source

  1. Open CI/CD → Editor and use the "Validate" tab with the target ref and pipeline source.
  2. Confirm a workflow rule matches that source (push, merge_request_event, schedule, web).
  3. Remember rule order matters - the first match wins, so put when: never exclusions before broad allows deliberately.

How to prevent it

  • Always end workflow:rules with a fallback allow for expected events.
  • Test rules against every pipeline source you support (push, MR, tag, schedule).
  • Keep when: never exclusions narrow and ordered before broad allow rules.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →