Allow expand variables in pipeline inputs when using trigger keyword

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

Problem

Today with Pipeline Inputs in order to use a variable as input value for a downstream pipeline (trigger keyword) we need to rely on pipeline variables, which we want to discourage.

Example:

linux:
  trigger:
    include:
      - local: template.yml
        inputs:
          operating_system: $CI_JOB_NAME  # this will be passed literal because inputs are used downstream as interpolation.
                                          # This will be evaluated to the downstream job name, not `linux`.
          stack: ruby

To solve this you need to define a variable:

linux:
  variables:
    OS: $CI_JOB_NAME
  trigger:
    include:
      - local: template.yml
        inputs:
          operating_system: $OS 
          stack: ruby

However, if the project of the downstream pipeline (in this case it's the same project) does not allow pipeline variables to be used, the user doesn't have an alternative.

Idea

Allow the input parameters to be specified as expanded with value and expand:

linux:
  trigger:
    include:
      - local: template.yml
        inputs:
          operating_system:
            value: $CI_JOB_NAME # expanded before passing the value.
            expand: true
          stack: ruby
          token:
            value: $GITLAB_TOKEN # Equivalent to compact version. Passed literal and will be expanded based on variables available downstream
Edited by 🤖 GitLab Bot 🤖