mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2026-01-11 12:08:25 +00:00
Add skip_push input option (#401)
Co-authored-by: Stefan Zweifel <stefan@stefanzweifel.dev>
This commit is contained in:
@@ -38,6 +38,7 @@ setup() {
|
||||
export INPUT_SKIP_DIRTY_CHECK=false
|
||||
export INPUT_SKIP_FETCH=false
|
||||
export INPUT_SKIP_CHECKOUT=false
|
||||
export INPUT_SKIP_PUSH=false
|
||||
export INPUT_DISABLE_GLOBBING=false
|
||||
export INPUT_CREATE_BRANCH=false
|
||||
export INPUT_INTERNAL_GIT_BINARY=git
|
||||
@@ -352,6 +353,24 @@ cat_github_output() {
|
||||
assert_equal $current_sha $remote_sha
|
||||
}
|
||||
|
||||
@test "If SKIP_PUSH is true git-push will not be called" {
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-{1,2,3}.txt
|
||||
|
||||
INPUT_SKIP_PUSH=true
|
||||
|
||||
run git_auto_commit
|
||||
|
||||
assert_success
|
||||
|
||||
assert_line "::debug::git-push will not be executed."
|
||||
|
||||
# Assert that the sha values are not equal on local and remote
|
||||
current_sha="$(git rev-parse --verify --short ${FAKE_DEFAULT_BRANCH})"
|
||||
remote_sha="$(git rev-parse --verify --short origin/${FAKE_DEFAULT_BRANCH})"
|
||||
|
||||
refute [assert_equal $current_sha $remote_sha]
|
||||
}
|
||||
|
||||
@test "It can checkout a different branch" {
|
||||
# Create foo-branch and then immediately switch back to ${FAKE_DEFAULT_BRANCH}
|
||||
git checkout -b foo
|
||||
|
||||
Reference in New Issue
Block a user