Skip to content

Instantly share code, notes, and snippets.

@ridakk
Created September 11, 2019 08:13
Show Gist options
  • Save ridakk/ed9ad67d6dad0cb54663cde1a41dfbb2 to your computer and use it in GitHub Desktop.
Save ridakk/ed9ad67d6dad0cb54663cde1a41dfbb2 to your computer and use it in GitHub Desktop.
git add & commit if there are changes
node {
stage('commit if changed') {
sh 'git diff --quiet && git diff --staged --quiet || git commit -am "chore: commit pipeline changes"'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment