feat(gitea): add Gitea App sources and private repo deployments (#12234)

This commit is contained in:
Andras Bacsai
2026-10-19 21:58:30 +02:00
committed by GitHub
parent dd456625ec
commit cf71fda5c1
50 changed files with 3727 additions and 52 deletions
+3 -2
View File
@@ -88,7 +88,7 @@ class GithubApp extends BaseModel
protected static function booted(): void
{
static::deleting(function (GithubApp $github_app) {
$applications_count = Application::where('source_id', $github_app->id)->count();
$applications_count = $github_app->applications()->count();
if ($applications_count > 0) {
throw new \Exception('You cannot delete this GitHub App because it is in use by '.$applications_count.' application(s). Delete them first.');
}
@@ -108,7 +108,8 @@ class GithubApp extends BaseModel
$isUsedElsewhere = $privateKey->servers()->exists()
|| $privateKey->applications()->exists()
|| $privateKey->githubApps()->where('id', '!=', $github_app->id)->exists()
|| $privateKey->gitlabApps()->exists();
|| $privateKey->gitlabApps()->exists()
|| $privateKey->giteaApps()->exists();
if (! $isUsedElsewhere) {
$privateKey->delete();