CI jobs are run although dependencies are skipped

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

Jobs are scheduled although dependencies are excluded by only: or except:.

Steps to reproduce

Run the following script which defines two mutually exclusive jobs dep-A and dep-B and a third one which takes artifacts from both ones:

stages:
- build
- deploy

dep-A:
    stage: build
    only:
    - X
    script:
    - echo A
    
dep-B:
    stage: build
    except:
    - X
    script:
    - echo B
    
deploy:
    stage: deploy
    dependencies:
    - dep-A
    - dep-B
    script:
    - echo deploy

Example Project

https://gitlab.com/ensc/test-ci-dep/pipelines/69583306

What is the current bug behavior?

The deploy job is scheduled (and would fail when it uses the artifacts)

What is the expected correct behavior?

The deploy job is skipped; e.g. in way like

deploy:
    only:
    - X
    except:
    - X

Relevant logs and/or screenshots

Screenshot-2019-7-5_Pipeline___Enrico_Scholz_test-ci-dep

Output of checks

This bug happens on GitLab.com

Edited Aug 10, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading