Home > Back-end >  CloudBees Jenkins Pipeline Job input Param not accessible in 'Pipeline script from SCM' se
CloudBees Jenkins Pipeline Job input Param not accessible in 'Pipeline script from SCM' se

Time:04-23

I've defined input Jenkins variable BRANCH as below enter image description here

I tried to access it in 'Pipeline script from SCM' but no luck. BRANCH value never evaluate? I used below syntaxes.

  1. ${BRANCH}
  2. ${params.BRANCH}
  3. ${env.BRANCH}
  4. BRANCH
  5. env.BRANCH

enter image description here

None of this evaluate to actual value, how can I get value that user specified?

hudson.plugins.git.GitException: Command 
"git fetch --tags --force --progress --prune -- origin
 refs/heads/env.BRANCH:refs/remotes/origin/env.BRANCH"
returned status code 128:

CodePudding user response:

Okay, I found that I've checked Lightweight checkout option and that's why it wasn't resolving this input param values.

I've uncheck Lightweight checkout option and ${BRANCH} is resolving it's value correctly

  • Related