title: How to make Jenkins automatically add webhook for Pipeline job?
body: <p>I have added credentials for Jenkins to be able to add a webhook. For that I did the following:</p>
  
  <ol>
  <li>Generated personal access token on GitHub with <code>repo</code> and <code>admin:repo_hook</code> scopes.</li>
  <li>Added <code>Secret text</code> credentials with corresponding token.</li>
  <li>Added GitHub Server with credentials from the previous step in <code>Manage Jenkins &gt; Configure System</code>.</li>
  </ol>
  
  <p>But then when I create Pipeline job, I see in the system log:</p>
  
  <pre><code>GitHub webhooks activated for job p1 with [] (events: [PUSH])
  </code></pre>
  
  <p>With Freestyle project I get:</p>
  
  <pre><code>GitHub webhooks activated for job fsp1 with [GitHubRepositoryName[host=github.com,username=user,repository=repo]] (events: [PUSH])
  PING webhook received from repo &lt;https://github.com/user/repo&gt;!
  </code></pre>
  
  <p>For Freestyle project I did the following:</p>
  
  <ol>
  <li>On <em>Source Code Management</em> tab chose <em>Git</em>, specified repository URL and credentials (Username with password).</li>
  <li>Checked <em>GitHub hook trigger for GITScm polling</em>.</li>
  </ol>
  
  <p>For Pipeline job:</p>
  
  <ol>
  <li>Checked <em>GitHub project</em> and specified repository URL.</li>
  <li>￼Checked <em>GitHub hook trigger for GITScm polling</em>.</li>
  </ol>
  
  <p>What am I missing?</p>