Using more robust git repository check
Publish PHP Package / docker (push) Successful in 5s Details

This commit is contained in:
Pavel Shevaev 2024-08-13 10:57:54 +03:00
parent 6a23fc97fd
commit 8ae4cff800
1 changed files with 3 additions and 1 deletions

View File

@ -51,7 +51,7 @@ task('composer_vendor_push', function($args) {
echo "Detected folder: '$repo'\n"; echo "Detected folder: '$repo'\n";
if(!git_is_repo($repo)) if(!git_is_repo($repo, true))
throw new Exception("'$repo' is not a valid Git repo!\n"); throw new Exception("'$repo' is not a valid Git repo!\n");
echo "It's a valid Git repo\n"; echo "It's a valid Git repo\n";
@ -63,6 +63,8 @@ task('composer_vendor_push', function($args) {
echo "========\n"; echo "========\n";
$last_remote_tag = get_git_last_remote_tag($repo); $last_remote_tag = get_git_last_remote_tag($repo);
if($last_remote_tag === false)
throw new Exception("Could not retrieve last remote tag");
echo "The last remote Git tag: $last_remote_tag\n"; echo "The last remote Git tag: $last_remote_tag\n";
$last_remote_version = GitVersion::parse($last_remote_tag); $last_remote_version = GitVersion::parse($last_remote_tag);