I need to access commit message of current fetch from git repository, while completing some sh steps of different stages of a pipe in jenkins; but I didn't find any proper solution for it. It would be also nice if I could set the commit message as an environment variable, so that I could access it later on.
Please note that this is not a repetitive question, because none of similar questions on stackoverflow addresses exactly what I need. I need to have commit message in all of sh steps of my pipeline.