stefanzweifel / git-auto-commit-action

Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
MIT License
2.02k stars 229 forks source link

Set --depth on git-fetch and make call to git-fetch optional #131

Closed stefanzweifel closed 3 years ago

stefanzweifel commented 3 years ago

In this PR we're adding a new skip_fetch input option to disable the call to git-fetch. As reported in #130, calling git-fetch can have a negative impact on the performance of the Action in huge git repositories.

In addition, we added the --depth argument to git-fetch to not fetch the entire history of the repo, but only the last 3 commits.


Sidenote: The call to git-fetch has been added in #108 in relation to a problem reported in #106 with branch names like refactor/name. The / previously created problems. By calling git fetch we've seemed to fix the error 🤷 Now that we have a test suite, it would probably make sense to switch to the proposed solution of using git switch (Will work on this in a separate PR)