From 486e817a40a9cd33099c57582577e7ec68f89a79 Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Wed, 19 Oct 2022 20:32:42 +0200 Subject: [PATCH] fix(github): return empty without repo in getRepoOwnerAndRepo helper --- .../src/apps/github/common/get-repo-owner-and-repo.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/apps/github/common/get-repo-owner-and-repo.ts b/packages/backend/src/apps/github/common/get-repo-owner-and-repo.ts index fcaec1f1..25891c40 100644 --- a/packages/backend/src/apps/github/common/get-repo-owner-and-repo.ts +++ b/packages/backend/src/apps/github/common/get-repo-owner-and-repo.ts @@ -1,9 +1,11 @@ type TRepoOwnerAndRepo = { - repoOwner: string; - repo: string; + repoOwner?: string; + repo?: string; } export default function getRepoOwnerAndRepo(repoFullName: string): TRepoOwnerAndRepo { + if (!repoFullName) return {}; + const [repoOwner, repo] = repoFullName.split('/'); return {