Create a new option for running when condition before stage input

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Currently, when using the "stage-level" input (here: https://jenkins.io/doc/book/pipeline/syntax/#input) the when condition of the stage is evaluated after the input is gathered.  We should add an option so the when condition is evaluated before the input is gathered. Something like:

      stage('Production Deploy') {
          agent { label 'linux' }
          when {
              branch "master"
              beforeInput  true
          }
          input { message 'Deploy to Production?' }
          steps {
              echo 'Deploying to Production ... '
          }             
      }

       
      Use cases

      • Evaluate the when condition before the input has been gathered.

      In scope

       

            Assignee:
            Jose Blas Camacho Taboada
            Reporter:
            Erik Elkins
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: