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.
# 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 matchesCommon 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.
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH' # fallback: any branch pushPreview against the actual source
- Open CI/CD → Editor and use the "Validate" tab with the target ref and pipeline source.
- Confirm a
workflowrule matches that source (push,merge_request_event,schedule,web). - Remember rule order matters - the first match wins, so put
when: neverexclusions before broad allows deliberately.
How to prevent it
- Always end
workflow:ruleswith a fallback allow for expected events. - Test rules against every pipeline source you support (push, MR, tag, schedule).
- Keep
when: neverexclusions narrow and ordered before broad allow rules.