The environment variable CHANGE_ID contains the PR number

On Friday, May 26, 2017 at 6:07:20 AM UTC+5:30, Cody Ebberson wrote:
>
> Hello,
>
> I'm configuring Github + Jenkins + Sonar.  Almost everything is working, 
> and I am incredibly pleased (great job!)  I'm now struggling with one 
> missing piece which seems like it should be simple.
>
> The last piece I need is the Github pull request *number* as an 
> environment variable to pass to Sonar for "preview" mode analysis.
>
> Here are the relevant components and versions:
>
> Jenkins version 2.46.3
> Jenkins "GitHub Branch Source Plugin" version 2.0.5
> Maven version 3.3.9
> Maven Sonar plugin version 3.3.0.603
> Sonar version  6.3.1.21392
> Sonar Github plugin version 1.4.1
>
> Per https://stackoverflow.com/a/32095346 it looks like the old "GitHub 
> Pull Request Builder" plugin added a ${ghprbPullId} environment variable. 
>  That environment variable is not set by the "GitHub Branch Source Plugin" 
> (as far as I can tell).
>
> A dump of "env" does not show anything about pull requests, change ID's, 
> etc.  The known pull request number is not anywhere in the logs.
>
> Suggestions?
>
> If this isn't available through Jenkins, I think we could do some curl + 
> Github API magic to search for the Pull Request number, but that obviously 
> seems suboptimal.
>
> Thanks in advance!
>
> Cody
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f9ef0661-d59a-47f4-a8f8-b734493edadc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to