Skip to content

Commit

Permalink
Update UI regex for matching branch to fix basic auth usage
Browse files Browse the repository at this point in the history
  • Loading branch information
bkneis authored and pascalbreuninger committed Jan 9, 2025
1 parent 016c613 commit f9147bd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import { TWorkspaceSourceType } from "@/types"

// WARN: Make sure these match the regexes in /pkg/git/git.go
const GIT_REPOSITORY_PATTERN =
"((?:(?:https?|git|ssh)://)?(?:[^@/\\n]+@)?(?:[^:/\\n]+)(?:[:/][^/\\n]+)+(?:\\.git)?)"
"((?:(?:https?|git|ssh|file):\/\/)?\/?(?:[^@\/\n]+@)?(?:[^:\/\n]+)(?:[:\/][^\/\n]+)+(?:\.git)?)"
const GIT_REPOSITORY_REGEX = new RegExp(GIT_REPOSITORY_PATTERN)
const BRANCH_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@([a-zA-Z0-9\\./\\-\\_]+)$`)
const BRANCH_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}(?:@([a-zA-Z0-9\./\-\_]+))?$`)
const COMMIT_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@sha256:([a-zA-Z0-9]+)$`)
const PR_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@pull\\/([0-9]+)\\/head$`)
const SUBPATH_REGEX = new RegExp(`^${GIT_REPOSITORY_PATTERN}@subpath:([a-zA-Z0-9\\./\\-\\_]+)$`)
Expand Down

0 comments on commit f9147bd

Please sign in to comment.