Skip to content

Instantly share code, notes, and snippets.

View mhpaler's full-sized avatar
🏷️
tags first, then tagging

mhpaler mhpaler

🏷️
tags first, then tagging
View GitHub Profile
@mhpaler
mhpaler / PR_title.groovy
Created December 21, 2018 19:34
Groovy script to add PR title as a environment variable to Jenkins build environment
// I had the need to access the PR title in a build triggered
// by a merge of that PR into the targeted repository. In our case,
// we use the GitHub hook trigger for GITScm polling setting provided
// by the Github plugin. This fires a webhook at your jenkins instance
// (must be configured in Github) when changes are pushed into the
// target repo. The code below is put into the Groovy script window
// provded by the Environment Injector Plugin.
// Get the current build environment variables.
def thr = Thread.currentThread()