So this might be useful to push back to the build status to the PR https://plugins.jenkins.io/pipeline-gitstatuswrapper/
But regarding checking out, I think the standard git checkout would work, but use the source branch url instead of the pr for that. So, something like; ``` git branch: XXX url: XXX, credentialsId: XXX ``` As a PR is purely highlighting a specific source repo and branch combination. Not sure if that helps or not. John On Wed, 27 Apr 2022 at 19:49, Dan Tran <[email protected]> wrote: > Hi John > > Thanks for responding > > I am looking for a snippet of Groovy code that can check out a GH PR > source. User will provide repo url, credential, and PR# > > -D > > > On Tuesday, April 26, 2022 at 9:47:47 AM UTC-7 [email protected] wrote: > >> To be clear, are you wanting; >> 1) github to trigger the job to run for that PR >> 2) jenkins job to detect PR and run job for that PR >> >> John >> >> >> On Tue, 26 Apr 2022 at 00:34, Dan Tran <[email protected]> wrote: >> >>> Hi >>> >>> I have been searching for groovy solution to check out a GH PR to my >>> Jenkins workspace, so far none of the suggestions works [1]. >>> >>> Have anyone able to get this scenario it working? >>> >>> Thanks >>> >>> -D >>> >>> >>> [1] >>> https://stackoverflow.com/questions/49114011/how-to-check-out-a-pull-request-with-jenkins-pipeline >>> >>> >>> -- >>> 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/984e6668-6422-4b95-9375-e4a74f2cc4f1n%40googlegroups.com >>> <https://groups.google.com/d/msgid/jenkinsci-users/984e6668-6422-4b95-9375-e4a74f2cc4f1n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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/b3a1686f-a742-4bb5-ae4d-dcc4eec66f02n%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/b3a1686f-a742-4bb5-ae4d-dcc4eec66f02n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAH9u10nmB7e2yTmauNpd%2By0EbFv4W8T3W%3DOMghrHu1aU%3D-2m6Q%40mail.gmail.com.
