mehrancodes/laravel-harbor

Issue with FORGE_SUBDOMAIN_PATTERN Regex Validation

Closed this issue · 0 comments

Encountered an issue while running php harbor provision:

$ php harbor provision
  INFO    Start finding the server.
  INFO    Finding the associated site.
  INFO    ---> Site not found.
  INFO    Creating a new site.
[2024-03-05 14:22:42] development.ERROR: App\Actions\FormattedBranchName::slugifyIt(): Argument #1 ($branch) must be of type string, null given, called in /Users/mehran/packages/harbor/app/Actions/FormattedBranchName.php on line 34 {"exception":"[object] (TypeError(code: 0): App\\Actions\\Formatted

BranchName::slugifyIt(): Argument #1 ($branch) must be of type string, null given, called in /Users/mehran/packages/harbor/app/Actions/FormattedBranchName.php on line 34 at /Users/mehran/packages/harbor/app/Actions/FormattedBranchName.php:42)
[stacktrace]
#0 /Users/mehran/packages/harbor/app/Actions/FormattedBranchName.php(34): App\\Actions\\FormattedBranchName->slugifyIt(NULL)
#1 /Users/mehran/packages/harbor/vendor/lorisleiva/laravel-actions/src/Concerns/AsObject.php(24): App\\Actions\\FormattedBranchName->handle(NULL, '/feature\\\\/(.+)/...')
#2 /Users/mehran/packages/harbor/app/Services/Forge/ForgeService.php(67): App\\Actions\\FormattedBranchName::run('325-update-welc...', '/feature\\\\/(.+)/

There's a mismatch between the regex pattern in FORGE_SUBDOMAIN_PATTERN and the provided branch name (FORGE_GIT_BRANCH). Suggesting a validation step to ensure a matching regex pattern and throwing a clear error message if not.