CI/CD Pipeline with inputs ignores workflow rules
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Context
We want to create a pipeline where the user is only allowed to create a pipeline when he pres the "New pipeline" button.
So we defined workflow rules.
With the old variables it is working as expected.
For the new inputs the pipeline get executed every time there is a change in the repo.
Implementation
.gitlab-ci.yml
# Input definition
spec:
inputs:
test_input:
description: 'Enter any text'
---
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: always
- when: never
stages:
- test
output_inputs:
stage: test
script:
- echo "$[[ inputs.test_input ]]"
Way to reproduce
Create a empty GitLab project and create the .gitlab-ci.yml file shown above.
For every change in the repository the pipeline get started which leads to a Unable to create pipeline error with
'.gitlab-ci.yml': 'test_input' input: required value has not been provided.
If you delete the first document from the .gitlab-ci.yml file with the input definition the workflow rule is respected.
Informations
GitLab version: GitLab Community Edition v18.3.3