1

I have a pipeline that uses the when condition with changeset to decide specific actions. However for first builds the when condition always evaluates to false because the changelog is empty. I get this warning in the console:

Warning, empty changelog. Have you run checkout?

Is there a way to use declarative syntax to check if the changelog is empty? Something like:

stage {
  when {
    changelog ''
  }
  steps {
    do stuff here
  }
}
LoneWolfPR
  • 3,978
  • 12
  • 48
  • 84
  • Many people give change sets more credit than is due. Specifically, if your build #1 fails and you rebuild it, the build #2 will have an empty change set. Your issue is another reason not to use them. Instead, you can parse the result of `git log` and decide based on that. – MaratC Dec 12 '21 at 10:14

0 Answers0