mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 00:02:56 +00:00
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
import type { GitHubOwnerRepo } from '../../shared/types'
|
||||
|
||||
const GITHUB_OWNER_SLUG_RE = /^[A-Za-z0-9][A-Za-z0-9-]*$/
|
||||
const GITHUB_REPO_SLUG_RE = /^[A-Za-z0-9._-]+$/
|
||||
|
||||
// Why: renderer/RPC overrides are interpolated into authenticated REST paths.
|
||||
export function isValidGitHubApiRepository(repository: GitHubOwnerRepo): boolean {
|
||||
return (
|
||||
GITHUB_OWNER_SLUG_RE.test(repository.owner) &&
|
||||
GITHUB_REPO_SLUG_RE.test(repository.repo) &&
|
||||
repository.repo !== '.' &&
|
||||
repository.repo !== '..'
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user