Skip to content

Commit 078674d

Browse files
committed
[projects] enable webhook registration for bitbucket.org and self-hosted gitlab
1 parent 34ed8e2 commit 078674d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/server/src/projects/projects-service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ export class ProjectsService {
115115
protected async onDidCreateProject(project: Project, installer: User) {
116116
let { userId, teamId, cloneUrl } = project;
117117
const parsedUrl = RepoURL.parseRepoUrl(project.cloneUrl);
118-
if ("gitlab.com" === parsedUrl?.host) {
119-
const repositoryService = this.hostContextProvider.get(parsedUrl?.host)?.services?.repositoryService;
118+
const hostContext = parsedUrl?.host ? this.hostContextProvider.get(parsedUrl?.host) : undefined;
119+
const type = hostContext && hostContext.authProvider.info.authProviderType;
120+
if (type === "GitLab" || type === "Bitbucket") {
121+
const repositoryService = hostContext?.services?.repositoryService;
120122
if (repositoryService) {
121123
// Note: For GitLab, we expect .canInstallAutomatedPrebuilds() to always return true, because earlier
122124
// in the project creation flow, we only propose repositories where the user is actually allowed to

0 commit comments

Comments
 (0)