Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor: Improve environment variable handling in shared.php

Andras Bacsai84093afaf665
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index 75c7a101cf..4bc83d1c5a 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -3074,19 +3074,17 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
$fqdnFor = null;
}
// Lets save the magic value to the environment variables
- if (! $originalValue->startsWith('/')) {
- if ($key->startsWith('SERVICE_')) {
- $originalValue = $key;
- }
- $resource->environment_variables()->where('key', $originalValue->value())->where($nameOfId, $resource->id)->firstOrCreate([
- 'key' => $originalValue->value(),
- $nameOfId => $resource->id,
- ], [
- 'value' => $value,
- 'is_build_time' => false,
- 'is_preview' => false,
- ]);
+ if ($key->startsWith('SERVICE_')) {
+ $originalValue = $key;
}
+ $resource->environment_variables()->where('key', $originalValue->value())->where($nameOfId, $resource->id)->firstOrCreate([
+ 'key' => $originalValue->value(),
+ $nameOfId => $resource->id,
+ ], [
+ 'value' => $value,
+ 'is_build_time' => false,
+ 'is_preview' => false,
+ ]);
}
}
}