title: Trigger Jenkins build based on a new GitHub release or commit to the master branch
body: <p>I realize this question has been asked before <a href="https://stackoverflow.com/questions/29742847/jenkins-trigger-build-if-new-tag-is-released">here</a>, <a href="https://stackoverflow.com/questions/7805603/is-it-possible-for-jenkins-to-automatically-detect-and-build-newly-created-tags">here</a>, and <a href="https://stackoverflow.com/questions/40809254/triggering-jenkins-build-on-both-new-tags-commits">here</a>, but none of these solutions appears to be working for my Jenkins setup and I can't figure out why.</p>
  
  <p>My objective is to trigger a Jenkins build when either a new commit is made to the <code>master</code> branch or when any tag (or in GitHub, a release) is added to the repo. Here's my current setup:</p>
  
  <p><a href="https://i.stack.imgur.com/kTDg7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kTDg7.png" alt="enter image description here"></a></p>
  
  <p>When I make a new commit to the <code>master</code> branch, a new build is triggered. But when I add a new GitHub release, nothing happens.</p>
  
  <p>Looking at my "Git Polling Log" shows the following output:</p>
  
  <pre><code>Started on Jun 20, 2017 1:25:00 AM
  Polling SCM changes on master
  Using strategy: Default
  [poll] Last Built Revision: Revision 035c0f46422616b1862376b79c43b2562dc66f93 (origin/master)
   &gt; git rev-parse --is-inside-work-tree # timeout=10
  Fetching changes from the remote Git repositories
   &gt; git config remote.origin.url git@github.com:some-org/sample-app-frontend.git # timeout=10
  Fetching upstream changes from git@github.com:some-org/sample-app-frontend.git
   &gt; git --version # timeout=10
  using GIT_SSH to set credentials GitHub SSH Key
   &gt; git fetch --tags --progress git@github.com:some-org/sample-app-frontend.git +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/remotes/origin/tags/*
  Polling for changes in
  Seen branch in repository origin/master
  Seen branch in repository origin/tags/stage-v0.0.1
  Seen branch in repository origin/tags/stage-v0.0.2
  Seen branch in repository origin/tags/stage-v0.0.3
  Seen branch in repository origin/tags/v0.0.4
  Seen branch in repository origin/tags/v0.0.5
  Seen branch in repository origin/tags/v0.0.6
  Seen branch in repository origin/tags/v0.0.7
  Seen 8 remote branches
   &gt; git tag -l # timeout=10
   &gt; git rev-parse refs/tags/stage-v0.0.2^{commit} # timeout=10
   &gt; git rev-parse refs/tags/v0.0.7^{commit} # timeout=10
   &gt; git rev-parse refs/tags/stage-v0.0.1^{commit} # timeout=10
   &gt; git rev-parse refs/tags/v0.0.6^{commit} # timeout=10
   &gt; git rev-parse refs/tags/v0.0.5^{commit} # timeout=10
   &gt; git rev-parse refs/tags/v0.0.4^{commit} # timeout=10
   &gt; git rev-parse refs/tags/stage-v0.0.3^{commit} # timeout=10
  Done. Took 0.2 sec
  No changes
  </code></pre>
  
  <p>Note that I'm using git polling once per minute. So it appears that git correctly detects the new branches, but somehow the git polling Jenkins is doing does not think a new branch qualifies as a "change" since it keeps reporting "No changes" at the bottom.</p>