This commit is contained in:
Khushboo Verma 2025-03-20 18:44:00 +05:30
parent c2d0aded6d
commit ec6683cfa9

View file

@ -1202,12 +1202,13 @@ class Builds extends Action
$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
$hostname = System::getEnv('_APP_DOMAIN');
$resourceType = match ($resource->getCollection()) {
'functions' => 'function',
'sites' => 'site',
$projectId = $project->getId();
$resourceId = $resource->getId();
$providerTargetUrl = match ($resource->getCollection()) {
'functions' => "{$protocol}://{$hostname}/console/project-{$projectId}/functions/function-{$resourceId}",
'sites' => "{$protocol}://{$hostname}/console/project-{$projectId}/sites/site-{$resourceId}",
default => throw new \Exception('Invalid resource type')
};
$providerTargetUrl = "{$protocol}://{$hostname}/console/project-{$project->getId()}/{$resource->getCollection()}/$resourceType-{$resource->getId()}";
$github->updateCommitStatus($repositoryName, $providerCommitHash, $owner, $state, $message, $providerTargetUrl, $name);
}