inputs with hyphens in name cause if expression error

Summary

Ran into a confusing problem with the dynamic input feature introduced in 18.7: https://gitlab.com/balagansky-work/test_hyphenated_inputs/-/blob/main/.gitlab-ci.yml

If inputs with hyphens in the name appear inside inputs:rules:if, an error is emitted: "if invalid expression syntax"

Steps to reproduce

  1. Define an input with a hyphen in the name, e.g. my-input
  2. Define another input with a rules:if section that refers to the hyphenated input, e.g. - if: $[[ inputs.my-input ]] == 'value'

Sample snippet:

spec:
  inputs:
    kebab-type:
      description: "The type of kebab, duh!"
      default: chicken
      options: ['chicken', 'lamb', 'beef', 'mushroom']
  
    chlorinated:
      description: "should protein be chlorinated"
      type: boolean
      rules:
        - if: $[[ inputs.kebab-type ]] == 'chicken'  # error!
          default: false

Example Project

https://gitlab.com/balagansky-work/test_hyphenated_inputs

What is the current bug behavior?

Yaml fails validation.

What is the expected correct behavior?

Yaml should validate and work as expected.

Relevant logs and/or screenshots

image

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Edited Feb 11, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading