1

I have a jenkins task which polls on a git repo.

It is triggered on every git push to that git repo.

Is there any way Jenkins can get the last push message?

UPDATE

I want my current jenkins task to trigger a build on another Jenkins task with the commit message as a parameter.

what is the syntax for that?

like this?

enter image description here

Burhan Ali
  • 2,258
  • 1
  • 28
  • 38
Elad Benda2
  • 13,852
  • 29
  • 82
  • 157

1 Answers1

1

All you need to do is define as a first build step which would get the last commit message:

git log -1 --pretty=%B

Then, with a plugin like the EnvInject+Plugin, you can inject the result into an environment variable that other build step can then reuse.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks. I want to pass it as a build param to another jenkins projects how can i do this? like i show in my updated question? – Elad Benda2 May 30 '17 at 09:49