Skip to content

"git fetch" call can take forever despite not being needed #130

@rdmurphy

Description

@rdmurphy

Is your feature request related to a problem? Please describe.
Hello! 👋 I'm a big fan of this action, but I've hit an interesting edge case and I was wondering if there's maybe a solution for it to be added. We have a repo with an workflow that clones the repo, runs a command (that updates a single file) and uses this action to re-commit it back. The branch that was checked out with actions/checkout@v2 is the same one that's being committed to — meaning all the information to make the commit should already be present. However, this repo has a massive history and tons of branches and tags, so when git-auto-commit-action does this git fetch call, it takes forever. The script we're running takes ~20 seconds to complete, and the git fetch is taking ~8 minutes.

Describe the solution you'd like
Is there a git safe way to either 1) not do that git fetch call at all if the current branch and the target branch are the same, 2) make that git fetch call retrieve less history? Either with a custom flag a user may append to the git fetch call (like how push_options works) or some other method?

Describe alternatives you've considered
The only option we've come up with is not using this action. 😅 Which is fine, but I really like what you have setup here!

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions