mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-07-31 06:57:40 +08:00
Add skip_fetch input option
This new option will allow users to skip the execution of `git fetch` if it has a negative impact in their workflows. In a future PR I will probably remove the call to git-fetch interely. It was added in #108 in relation to a problem with slashes in branch names. That problem wasn't properly fixed though.
This commit is contained in:
@@ -41,7 +41,12 @@ _switch_to_branch() {
|
||||
echo "INPUT_BRANCH value: $INPUT_BRANCH";
|
||||
|
||||
# Fetch remote to make sure that repo can be switched to the right branch.
|
||||
git fetch --depth=3;
|
||||
|
||||
if "$INPUT_SKIP_FETCH"; then
|
||||
echo "::debug::git-fetch has not been executed";
|
||||
else
|
||||
git fetch --depth=3;
|
||||
fi
|
||||
|
||||
# Switch to branch from current Workflow run
|
||||
# shellcheck disable=SC2086
|
||||
|
Reference in New Issue
Block a user