mirror of
https://github.com/reecetech/version-increment.git
synced 2025-12-21 06:25:44 +00:00
Update action to support with tag_prefix parameter
This commit is contained in:
@@ -409,3 +409,24 @@ function init_repo {
|
||||
[[ "$output" = *"VERSION=1.2.4"* ]]
|
||||
[[ "$output" = *"No conventional commit found"* ]]
|
||||
}
|
||||
|
||||
|
||||
@test "increments the patch version by default if no conventional commits found and enabled (conventional commits) (with tag_prefix)" {
|
||||
init_repo
|
||||
|
||||
export tag_prefix="@org/product"
|
||||
export current_version="@org/product@1.2.3"
|
||||
export scheme="conventional_commits"
|
||||
|
||||
echo "some new change" > feat.txt
|
||||
git add feat.txt
|
||||
git commit -m "new change"
|
||||
|
||||
run ../../version-increment.sh
|
||||
|
||||
print_run_info
|
||||
[ "$status" -eq 0 ] &&
|
||||
[[ "$output" = *"VERSION=@org/product@1.2.4"* ]]
|
||||
[[ "$output" = *"V_VERSION=@org/product@v1.2.4"* ]]
|
||||
[[ "$output" = *"No conventional commit found"* ]]
|
||||
}
|
||||
|
||||
@@ -72,6 +72,37 @@ function init_repo {
|
||||
[[ "$output" = *"CURRENT_V_VERSION=v0.1.2"* ]]
|
||||
}
|
||||
|
||||
@test "finds the current normal version with tag_prefix enabled" {
|
||||
init_repo
|
||||
|
||||
export tag_prefix="@org/product"
|
||||
|
||||
git tag @org/product@0.0.1
|
||||
git tag @org/product@0.1.1
|
||||
git tag @org/product@0.1.2
|
||||
|
||||
run version-lookup.sh
|
||||
|
||||
print_run_info
|
||||
[ "$status" -eq 0 ] &&
|
||||
[[ "$output" = *"CURRENT_VERSION=0.1.2"* ]]
|
||||
}
|
||||
|
||||
@test "tag_prefix enabled prefixes with a v" {
|
||||
init_repo
|
||||
|
||||
export tag_prefix="@org/product"
|
||||
|
||||
git tag @org/product@0.1.2
|
||||
|
||||
run version-lookup.sh
|
||||
|
||||
print_run_info
|
||||
[ "$status" -eq 0 ] &&
|
||||
[[ "$output" = *"CURRENT_VERSION=0.1.2"* ]] &&
|
||||
[[ "$output" = *"CURRENT_V_VERSION=v0.1.2"* ]]
|
||||
}
|
||||
|
||||
@test "finds the current normal version even if there's a newer pre-release version" {
|
||||
init_repo
|
||||
|
||||
|
||||
Reference in New Issue
Block a user