title: How to check out a Pull-Request with Jenkins Pipeline?
body: <p>I would like to build a Pipeline that integrates multiple repositories.</p>
  
  <p>The general idea:</p>
  
  <ol>
  <li>Provide a branch name as input.</li>
  <li>Use the GitHub-API to find Pull-Requests across several projects, that were created from a branch with that name.</li>
  <li>Make (shallow) clones from several repositories, checking out the specified Pull-Requests.</li>
  </ol>
  
  <p>Note that I am <em>not</em> trying to trigger the build itself from a Pull-Request.
  The triggering Job is just a plain Pipeline script.
  So <code>checkout scm</code> does not apply in my case.
  I would be nice to get this triggered from Pull-Requests.
  The many Multi-Branch plugins for Jenkins do not help me though, because they assume only a single repository to be part of the build.</p>
  
  <p>So far, I mostly avoided calling <code>git</code> from an <code>sh</code> step, because that would bring me close to throwing away any and all Jenkins-Git-integration.</p>
  
  <p>How, if at all, can I use the Pipeline <code>checkout</code> method to directly check out a Pull-Request?</p>
  
  <p>Is this even in scope of the <code>checkout</code> method?
  Probably, what I am looking for is interacting directly with the JGit client of Jenkins, at which point I might just as well use <code>sh</code> commands...</p>