Browse Source

Escape $ to fix Jenkins interpolation warning (#5178)

Escaping $ in "" string makes the variable expanded by shell, and not Jenkins itself

Explained in example in official docs
https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#for-other-credential-types
Anatoli Babenia 2 years ago
parent
commit
122eea5215
1 changed files with 1 additions and 1 deletions
  1. 1 1
      .cico.pipeline

+ 1 - 1
.cico.pipeline

@@ -9,7 +9,7 @@ def notifyPagurePR(repo, msg, status, phase, credentials = 'pagure-auth'){
           wait for jenkins to be done, so if we wait for pagure's answer we're
           basically stuck in a loop where both jenkins and pagure are waiting
           for each other */
-        sh "timeout 1 curl -X POST -d \'$json\' https://pagure.io/api/0/ci/jenkins/$repo/${PAGURE_PUSH_SECRET}/build-finished -H \"Content-Type: application/json\" | true"
+        sh "timeout 1 curl -X POST -d \'$json\' https://pagure.io/api/0/ci/jenkins/$repo/\${PAGURE_PUSH_SECRET}/build-finished -H \"Content-Type: application/json\" | true"
     }
 }