Hello, I have the following code:
.gitlab-ci.yml
variables:
GIT_CLONE_PATH: ‘$CI_BUILDS_DIR$CI_PROJECT_NAME$CI_PIPELINE_ID$CI_JOB_ID$CI_PROJECT_NAME’
stages:
- test
include:
- local: ‘api-generic.yml’
inputs:
jobprefix: “${jobprefix}” # Pass the variable (can be manually overridden)
jobstage: “test” # Specify the stage (optional, has a default)
environment: “staging” # Pass the environment
api-generic.yml
spec:
inputs:
jobprefix: # Mandatory string input
description: “Define a prefix for the job name”
jobstage: # Optional string input with a default value when not provided
default: test
environment: # Mandatory input that must match one of the options
options: [‘test’, ‘staging’, ‘production’]
export_results: # Optional boolean input with a default value when not provided
type: boolean
default: true
“$[[ inputs.jobprefix ]]-scan-website”:
stage: $[[ inputs.jobstage ]]
script:
- echo “scanning website -e $[[ inputs.jobprefix ]]”
When running the pipeline, I pass jobprefix=test, so in jobs page, i should see test-scan-website as the job name, however, i see ${jobprefix}-scan-website. What am i doing wrong? why is “${jobprefix}” not evaluating?