Save-Git.ps1 445 B

123456789101112131415161718
  1. function Save-Git() {
  2. $pushed = $Info.result.pushed
  3. if (!$Info.pushed) { "Git: no package is pushed to Chocolatey community feed, skipping"; return }
  4. ""
  5. "Executing git pull"
  6. git checkout master
  7. git pull
  8. "Commiting updated packages to git repository"
  9. $pushed | % { git add $_.PackageName }
  10. git commit -m "UPDATE BOT: $($Info.pushed) packages updated
  11. [skip ci]"
  12. "Pushing git changes"
  13. git push
  14. }