mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Refactor
This commit is contained in:
parent
c2d0aded6d
commit
ec6683cfa9
1 changed files with 5 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue