Jenkinsfile credential as paramter unable to use it
withCredentials publish environment variables, and in sh to access the environment variables, you have to do it like this: &quot;${env.JOB_BASE_NAME}&quot;.
Try this:
withCredentials([usernamePassword(credentialsId: params.git_credential, passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USERNAME')]) {
   sh 'git reset --hard; git clone https://${env.DOCKER_USERNAME}:${env.DOCKER_PASSWORD}@repo_url/scm/${params.repository}.git --branch master'
}