mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-07-21 23:56:09 +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:
@@ -21,6 +21,7 @@ setup() {
|
||||
export INPUT_TAGGING_MESSAGE=""
|
||||
export INPUT_PUSH_OPTIONS=""
|
||||
export INPUT_SKIP_DIRTY_CHECK=false
|
||||
export INPUT_SKIP_FETCH=false
|
||||
|
||||
# Configure Git
|
||||
if [[ -z $(git config user.name) ]]; then
|
||||
@@ -297,3 +298,16 @@ git_auto_commit() {
|
||||
run git ls-remote --tags --refs
|
||||
assert_output --partial refs/tags/v2.0.0
|
||||
}
|
||||
|
||||
@test "If SKIP_FETCH is true git-fetch will not be called" {
|
||||
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-{1,2,3}.txt
|
||||
|
||||
INPUT_SKIP_FETCH=true
|
||||
|
||||
run git_auto_commit
|
||||
|
||||
assert_success
|
||||
|
||||
assert_line "::debug::git-fetch has not been executed"
|
||||
}
|
||||
|
Reference in New Issue
Block a user