title: Jenkins ⇔ Github-Webhook setup for multiple repositories
body: <p>In order for Jenkins to be able to have access to multiple repositories on the same server, I set the <code>.ssh/config</code> as follow:</p>
  
  <pre><code>Host a.github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/project-a-id_rsa
  
  # same for other repos
  </code></pre>
  
  <p>and set the Jenkins jobs' <em>Source Code Management</em> (SCM), to <code>git</code> and <code>git@a.github.com:user/repo_a.git</code>. It works fine.</p>
  
  <p><strong>Problem</strong><br>
  I want those jobs to be triggered on push events so I set a webhook service in github, .i.e, <em>Jenkins (GitHub plugin)</em>. The request received from the webhook are "POST for <a href="https://github.com/user/repo_a" rel="nofollow">https://github.com/user/repo_a</a>" which is a different host than the one set in the SCM, .i.e, <code>a.github.com</code>.<br>
  Because they are different, the job does not build automatically.</p>
  
  <p><strong>Ugly Solution</strong><br>
  I got something running by setting the SCM to <code>github.com</code> and override the remote url of the project's git config once cloned with <code>a.github.com</code>. So the SCM would match the webhook, and jenkins when running <code>git push</code> would use the <code>.ssh/config</code> info.</p>
  
  <p><strong>Question</strong><br>
  What else can I do ? Is there a better, easily automated way to achieve this?</p>