title: Jenkins publish changes in repository to github using pipeline and groovy
body: <p>I have a jenkins organization pipeline job that executes on all repositories that have "Jenkinsfile" defined. The job clones the repository from github, then runs the powershell script that increments the version number in the file. I'm now trying to publish that updated file back to the original repository on github, so when developer pulls the changes he gets the latest version number.</p>
  
  <p>I tried using the script (inside "jenkinsfile") as suggested in jenkins JIRA (<a href="https://issues.jenkins-ci.org/browse/JENKINS-28335" rel="nofollow noreferrer">https://issues.jenkins-ci.org/browse/JENKINS-28335</a>), but to no avail. Any suggestions will be appreciated. Basically need to execute "git commit" and "git push" using the same parameters defined for a job. </p>
  
  <p>Just as a reference, here is a previous solution used for free style (not pipeline job): <a href="https://stackoverflow.com/questions/19922435/how-to-push-changes-to-github-after-jenkins-build-completes">How to push changes to github after jenkins build completes?</a>.</p>