mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-05-24 15:49:43 +08:00
Emit warning if deprecated/removed options are used
This commit is contained in:
parent
739fd03b2d
commit
e7955f713c
@ -27,6 +27,18 @@ _log() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_main() {
|
_main() {
|
||||||
|
if "$INPUT_SKIP_FETCH"; then
|
||||||
|
_log "warning" "skip_fetch has been removed in v6. It does not have any effect anymore.";
|
||||||
|
fi
|
||||||
|
|
||||||
|
if "$INPUT_SKIP_CHECKOUT"; then
|
||||||
|
_log "warning" "skip_checkout has been removed in v6. It does not have any effect anymore.";
|
||||||
|
fi
|
||||||
|
|
||||||
|
if "$INPUT_CREATE_BRANCH"; then
|
||||||
|
_log "warning" "create_branch has been removed in v6. It does not have any effect anymore.";
|
||||||
|
fi
|
||||||
|
|
||||||
_check_if_git_is_available
|
_check_if_git_is_available
|
||||||
|
|
||||||
_switch_to_repository
|
_switch_to_repository
|
||||||
|
@ -38,6 +38,11 @@ setup() {
|
|||||||
export INPUT_DISABLE_GLOBBING=false
|
export INPUT_DISABLE_GLOBBING=false
|
||||||
export INPUT_INTERNAL_GIT_BINARY=git
|
export INPUT_INTERNAL_GIT_BINARY=git
|
||||||
|
|
||||||
|
# Deprecated variables. Will be removed in future versions
|
||||||
|
export INPUT_CREATE_BRANCH=false
|
||||||
|
export INPUT_SKIP_FETCH=false
|
||||||
|
export INPUT_SKIP_CHECKOUT=false
|
||||||
|
|
||||||
# Set GitHub environment variables used by the GitHub Action
|
# Set GitHub environment variables used by the GitHub Action
|
||||||
temp_github_output_file=$(mktemp -t github_output_test.XXXXX)
|
temp_github_output_file=$(mktemp -t github_output_test.XXXXX)
|
||||||
export GITHUB_OUTPUT="${temp_github_output_file}"
|
export GITHUB_OUTPUT="${temp_github_output_file}"
|
||||||
@ -1161,3 +1166,17 @@ END
|
|||||||
run git tag
|
run git tag
|
||||||
assert_output ""
|
assert_output ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "it shows warning message if any deprecated options are used" {
|
||||||
|
INPUT_SKIP_FETCH=true
|
||||||
|
INPUT_SKIP_CHECKOUT=true
|
||||||
|
INPUT_CREATE_BRANCH=true
|
||||||
|
|
||||||
|
run git_auto_commit
|
||||||
|
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
assert_line "::warning::skip_fetch has been removed in v6. It does not have any effect anymore."
|
||||||
|
assert_line "::warning::skip_checkout has been removed in v6. It does not have any effect anymore."
|
||||||
|
assert_line "::warning::create_branch has been removed in v6. It does not have any effect anymore."
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user