title: Jenkins scripted pipeline environment variable
body: <p>I'm using the Jenkins scripted pipeline and since the last update I get a new warning, which I want to silence, here is an MWE:</p>
  <pre><code>// FROM https://jenkins.io/doc/pipeline/examples/#parallel-multiple-nodes
  
  def labels = []
  
  if (Host == 'true') {
      labels.add('&lt;host-slavename&gt;')
  }
  
  def builders = [:]
  
  for (x in labels) {
      def label = x
  
      builders[label] = {
          ansiColor('xterm') {
              node(label) {
                  stage('cleanup') {
                      deleteDir()
                  }
                  stage('build') {
                      def timestamp = sh (script: 'echo -n `(date +%Y%m%d%H%M%S)`', returnStdout: true)
  
                      withCredentials([string(credentialsId: 'TEST_PASSWORD', variable: 'PASSWORD')]){
  
                          sh &quot;&quot;&quot;
                              logger \
                              TEST_1 &quot;${PASSWORD}&quot; TEST_2 \
                              TEST_3 $timestamp TEST_4
                          &quot;&quot;&quot;
  
                          sh '''
                              logger \
                              TEST_1 &quot;$PASSWORD&quot; TEST_2 \
                              TEST_3 $timestamp TEST_4
                          '''
                          
                      }
                  }
              }
          }
      }
  }
  
  parallel builders
  </code></pre>
  <p>the first <code>sh</code> block returns</p>
  <pre><code>Warning: A secret was passed to &quot;sh&quot; using Groovy String interpolation, which is insecure.
           Affected argument(s) used the following variable(s): [PASSWORD]
           See https://jenkins.io/redirect/groovy-string-interpolation for details.
  + logger TEST_1 **** TEST_2 TEST_3 20211029074911 TEST_4
  </code></pre>
  <p>which at least prints the timestamp and the password (it's censored, but works), but raises the warning.</p>
  <p>the second <code>sh</code> block returns</p>
  <pre><code>+ logger TEST_1 **** TEST_2 TEST_3 TEST_4
  </code></pre>
  <p>So no warning, but also no timestamp.</p>
  <p>Is there a way to write a scripted pipeline that shows no warning, but still the timestamp?</p>