title: How to get Jenkins to push to GitHub but not trigger a build off that push
body: <h2>The Setup</h2>
  
  <p>I've got a Mac mini set up with Jenkins pulling a repo down from GitHub and performing an Xcode build. Because the mini is firewalled off from the internet I am polling GitHub for changes every 15 minutes.</p>
  
  <p>Prior to kicking off the Xcode build I have Jenkins execute the following script to bump my project build number and commit the results to the repo:</p>
  
  <pre><code>#!/bin/sh
  
  agvtool bump -all
  /usr/local/git/bin/git commit -a -m "This is Jenkins, updating your build numbers, sir."
  </code></pre>
  
  <p>After the build I have a post-build action set up to run another script that pulls and then pushes from GitHub, like so:</p>
  
  <pre><code>#!/bin/sh
  
  /usr/local/git/bin/git pull origin develop
  /usr/local/git/bin/git push origin develop
  </code></pre>
  
  <h2>The Problem</h2>
  
  <p>Because Jenkins is performing a commit and a push to GitHub each time it runs, the next poll will find the changes it pushed up last time, creating a new build whether there were other actual changes or not.</p>
  
  <h2>The Question</h2>
  
  <p>Is there something wonky in my setup that I should be doing differently? I'd like Jenkins to update my Xcode target's build number and commit and push that result to GitHub. This configuration obviously accomplishes that, but with the side effect of a build every 15 minutes, instead of a build every 15 minutes as needed.</p>
  
  <p>Jenkins is consulting the SHA1 of the lastSuccessfulBuild to determine if there have been changes, but it's doing that before my commit. Is there a way to set the SHA1 of the current build to the hash resulting from the commit of the version number bump? Something like so:</p>
  
  <pre><code>#!/bin/sh
  
  agvtool bump -all
  /usr/local/git/bin/git commit -a -m "This is Jenkins, updating your build numbers, sir."
  NEW_SHA=$(/usr/local/git/bin/git rev-parse HEAD)
  # Some awesome Jenkins-fu to set the SHA1 of the current build to NEW_SHA
  </code></pre>
  
  <p>This way when Jenkins compares hashes the next time around it won't build unless there have been changes since its commit to bump version numbers.</p>
  
  <p>Thanks for any and all help.</p>