GitLab "Pipeline will not run for the selected trigger": fix the rules

By Melih Toksari, developer of MergeBell · Updated · 3 min read

Short answer

Before GitLab 17.3, GitLab showed "Pipeline will not run for the selected trigger. The rules configuration prevented any jobs from being added to the pipeline." when no job's rules matched the pipeline you started. Since 17.3 the same case reads "The resulting pipeline would have been empty", and workflow:rules that stop everything give "The pipeline did not run", formerly "Pipeline filtered out by workflow rules". The usual cause is rules written for pushes or merge requests: a New pipeline run has $CI_PIPELINE_SOURCE set to web, the API to api, a trigger token to trigger. Add a rule for that source, such as - if: $CI_PIPELINE_SOURCE == "web", to workflow:rules and to the jobs that should run.

You open Build › Pipelines, select New pipeline, pick a branch, select New pipeline again, and get:

Pipeline cannot be run.
Pipeline will not run for the selected trigger. The rules configuration prevented any jobs from being added to the pipeline.

That’s the wording before GitLab 17.3; before 17.7, both buttons also said Run pipeline. Newer versions say the same things differently. In GitLab 19.5:

  • “The resulting pipeline would have been empty. Review the rules configuration.” No job’s rules matched, so no job was added. This replaced “Pipeline will not run for the selected trigger”.
  • “The pipeline did not run. Review the workflow:rules configuration for the pipeline.” workflow:rules stopped the whole pipeline. This replaced “Pipeline filtered out by workflow rules”.

The file is valid; the rules match nothing. A push that matches nothing creates no pipeline and no message at all: you only see one when you start a pipeline yourself, with New pipeline, the API or a trigger token.

The usual cause: the pipeline source

Every pipeline has a source in $CI_PIPELINE_SOURCE, and rules usually test it:

  • push: a Git push to a branch or tag.
  • merge_request_event: a merge request pipeline.
  • web: New pipeline in Build › Pipelines.
  • api: the pipelines API. trigger: a trigger token.
  • schedule: a pipeline schedule.
  • parent_pipeline: a child pipeline.

Rules written for push or merge_request_event alone match nothing when you select New pipeline. Add the source to workflow:rules and to each job that should run:

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_PIPELINE_SOURCE == "web"

test:
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_PIPELINE_SOURCE == "web"
  script: make test

GitLab checks each job’s rules in order and uses the first that matches; a job with no matching rule is left out.

Other rules that leave nothing

  • $CI_COMMIT_BRANCH in tag and merge request pipelines. It’s set only in branch pipelines, so if: $CI_COMMIT_BRANCH == "main" never matches them. Use $CI_COMMIT_TAG, or $CI_MERGE_REQUEST_TARGET_BRANCH_NAME in merge request pipelines.
  • GitLab’s MergeRequest-Pipelines template. Workflows/MergeRequest-Pipelines.gitlab-ci.yml, now deprecated, allows only merge requests, tags and the default branch, so New pipeline on any other branch is filtered out.
  • A variable you meant to pass. Rules like if: $DEPLOY == "true" match only when the run sets DEPLOY. Who may pass variables is set by Settings › CI/CD › Variables › Minimum role to use pipeline variables. New projects take their top-level group’s default: usually Developer on GitLab Self-Managed, and No one allowed in newer GitLab.com groups.
  • Only .pre and .post jobs. They don’t count as a pipeline on their own.
  • only and except filter the same way: a job with only: [merge_requests] never joins a New pipeline run.

rules:changes is rarely the cause: in pipelines without a push, such as New pipeline, API and scheduled ones, it’s always true.

Check before you push

Build › Pipeline editor › Validate simulates the pipeline that a push to a branch would create, so it shows which jobs your push rules keep. It can’t simulate New pipeline, API or merge request sources: for those, run the pipeline and read the message. On a merge request, Run pipeline only says “Pipeline creation failed. Please try again.”; Run pipeline with modified values opens the New pipeline form, which shows the reason.

On your phone

MergeBell shows a merge request’s pipelines with live job logs, and Retry reruns a failed job on the free tier. A pipeline that was never created has nothing to show or retry: the rules fix needs a commit, and New pipeline needs GitLab in a browser.

Frequently asked questions

What does "Pipeline will not run for the selected trigger" mean in GitLab?

No job's rules matched the pipeline you started, so GitLab refused to create an empty one. The .gitlab-ci.yml file is valid. Usually the rules were written for pushes or merge requests, and you started the pipeline with New pipeline, the API or a trigger token, which have other pipeline sources. Since GitLab 17.3, the message reads "The resulting pipeline would have been empty".

What does "The resulting pipeline would have been empty" mean in GitLab?

It's the GitLab 17.3 and later wording of "Pipeline will not run for the selected trigger": every job's rules left it out. Its sibling, "The pipeline did not run. Review the workflow:rules configuration for the pipeline.", means workflow:rules stopped the whole pipeline; before 17.3 that one read "Pipeline filtered out by workflow rules".

How do I make New pipeline work with rules in GitLab?

Pipelines started with Build › Pipelines › New pipeline have $CI_PIPELINE_SOURCE set to web. Add - if: $CI_PIPELINE_SOURCE == "web" to workflow:rules, if the file has them, and to the rules of each job that should run.

Why does a push create no GitLab pipeline and no error?

The same rules filtering happened, but GitLab only shows the message when you start a pipeline yourself. Check that workflow:rules and job rules match push pipelines, and that rules using $CI_COMMIT_BRANCH aren't meant for tag or merge request pipelines, where it isn't set.

Can I test GitLab CI rules before pushing?

Partly. Build › Pipeline editor › Validate simulates the pipeline a push to a branch would create, and CI Lint simulates a push to the default branch. Neither simulates New pipeline, API or merge request pipelines: for those, run the pipeline and read the message.

Sources

Checked against these pages on 6 November 2026. GitLab changes quickly — if something here no longer matches, tell us and we will fix it.

Do this from your phone with MergeBell

Free for the whole review loop: the To-Do inbox, diffs and line comments, approve and merge, pipelines with retry, and push alerts for your To-Dos. Works with gitlab.com and self-managed GitLab 16.0+.

Get MergeBell for iPhoneGet MergeBell for Android

On the App Store for iOS 26 or later and on Google Play for Android 12 or later. An independent app, not affiliated with GitLab Inc.