Fix failing pushes
This commit is contained in:
parent
6522d86fa9
commit
0ed2723f00
1 changed files with 4 additions and 4 deletions
|
@ -289,12 +289,14 @@ $createGitDeployments = function (GitHub $github, string $installationId, array
|
||||||
$dbForProject = $getProjectDB($project);
|
$dbForProject = $getProjectDB($project);
|
||||||
|
|
||||||
$functionId = $resource->getAttribute('resourceId');
|
$functionId = $resource->getAttribute('resourceId');
|
||||||
|
$function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));
|
||||||
|
|
||||||
$deploymentId = ID::unique();
|
$deploymentId = ID::unique();
|
||||||
$vcsRepoId = $resource->getId();
|
$vcsRepoId = $resource->getId();
|
||||||
$vcsRepoInternalId = $resource->getInternalId();
|
$vcsRepoInternalId = $resource->getInternalId();
|
||||||
$vcsInstallationId = $resource->getAttribute('vcsInstallationId');
|
$vcsInstallationId = $resource->getAttribute('vcsInstallationId');
|
||||||
$vcsInstallationInternalId = $resource->getAttribute('vcsInstallationInternalId');
|
$vcsInstallationInternalId = $resource->getAttribute('vcsInstallationInternalId');
|
||||||
$productionBranch = $resource->getAttribute('branch', 'main');
|
$productionBranch = $function->getAttribute('vcsBranch');
|
||||||
$activate = false;
|
$activate = false;
|
||||||
|
|
||||||
if ($branchName == $productionBranch) {
|
if ($branchName == $productionBranch) {
|
||||||
|
@ -303,7 +305,7 @@ $createGitDeployments = function (GitHub $github, string $installationId, array
|
||||||
|
|
||||||
$latestDeployment = Authorization::skip(fn () => $dbForProject->findOne('deployments', [
|
$latestDeployment = Authorization::skip(fn () => $dbForProject->findOne('deployments', [
|
||||||
Query::equal('vcsRepositoryId', [$vcsRepoId]),
|
Query::equal('vcsRepositoryId', [$vcsRepoId]),
|
||||||
Query::equal('branch', [$branchName]),
|
Query::equal('vcsBranch', [$branchName]),
|
||||||
Query::equal('resourceType', ['functions']),
|
Query::equal('resourceType', ['functions']),
|
||||||
Query::orderDesc('$createdAt'),
|
Query::orderDesc('$createdAt'),
|
||||||
]));
|
]));
|
||||||
|
@ -324,8 +326,6 @@ $createGitDeployments = function (GitHub $github, string $installationId, array
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$function = Authorization::skip(fn () => $dbForProject->getDocument('functions', $functionId));
|
|
||||||
|
|
||||||
$deployment = $dbForProject->createDocument('deployments', new Document([
|
$deployment = $dbForProject->createDocument('deployments', new Document([
|
||||||
'$id' => $deploymentId,
|
'$id' => $deploymentId,
|
||||||
'$permissions' => [
|
'$permissions' => [
|
||||||
|
|
Loading…
Reference in a new issue