Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47577

Post when stage is skipped due to when conditional

    XMLWordPrintable

Details

    Description

      The following pipeline does not trigger the post section:

      pipeline {
          agent any
      
          stages {
              stage('Test') {
                  when {
                      expression { return false; }
                  }
                  steps {
                      echo 'working'
                  }
                  post {
                      always {
                          echo 'post'
                      }
                  }
              }
          }
      }
      

      I expected this to actually echo 'post' and for post to also have a 'skipped' option. Would love to see those.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              omervk Omer van Kloeten
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: