fix(applications): treat zero private_key_id as deploy key (#8563)
This commit is contained in:
commit
46923f7e77
2 changed files with 12 additions and 1 deletions
|
|
@ -990,7 +990,7 @@ public function deploymentType()
|
|||
if (isDev() && data_get($this, 'private_key_id') === 0) {
|
||||
return 'deploy_key';
|
||||
}
|
||||
if (data_get($this, 'private_key_id')) {
|
||||
if (! is_null(data_get($this, 'private_key_id'))) {
|
||||
return 'deploy_key';
|
||||
} elseif (data_get($this, 'source')) {
|
||||
return 'source';
|
||||
|
|
|
|||
11
tests/Unit/ApplicationDeploymentTypeTest.php
Normal file
11
tests/Unit/ApplicationDeploymentTypeTest.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Application;
|
||||
|
||||
it('treats zero private key id as deploy key', function () {
|
||||
$application = new Application();
|
||||
$application->private_key_id = 0;
|
||||
$application->source = null;
|
||||
|
||||
expect($application->deploymentType())->toBe('deploy_key');
|
||||
});
|
||||
Loading…
Reference in a new issue