Jenkins checkout scm: how to get tags?

Viewed 1069

In my Jenkinsfile, I have below, which seems to clone the latest version that triggered the Jenkins build. However, it did not fetch any tags.

Is there a way to customize checkout scm to fetch all git tags?

stage('Checkout') {
  steps {
    checkout scm
  }
}
1 Answers

More of a workaround than an answer, but I just added git fetch --all --tags after the above step.

Related