From 3a40f3c5dfc2bbc746efbd4106c0481f184fb302 Mon Sep 17 00:00:00 2001 From: cmoulliard Date: Wed, 20 Dec 2023 16:59:50 +0100 Subject: [PATCH] Removing owner as non needed Signed-off-by: cmoulliard --- .../src/actions/gitea.test.ts | 3 ++- .../scaffolder-backend-module-gitea/src/actions/gitea.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.test.ts b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.test.ts index 4be82a0e12..ee0457cac0 100644 --- a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.test.ts +++ b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.test.ts @@ -88,6 +88,7 @@ describe('publish:gitea', () => { it('should throw if there is no repositoryId returned', async () => { server.use( rest.post('https://gitea.com/api/v1/user/repos', (req, res, ctx) => { + // Basic auth must match the user and password defined part of the config expect(req.headers.get('Authorization')).toBe( 'Basic Z2l0ZWFfdXNlcjpnaXRlYV9wYXNzd29yZA==', ); @@ -107,7 +108,7 @@ describe('publish:gitea', () => { ...mockContext, input: { ...mockContext.input, - repoUrl: 'gitea.com?owner=owner&repo=repo', + repoUrl: 'gitea.com?repo=repo', }, }); diff --git a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts index a68f92592e..cc16359d75 100644 --- a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts +++ b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts @@ -40,7 +40,7 @@ const createGiteaProject = async ( description: string; }, ): Promise => { - const { projectName, owner, description } = options; + const { projectName, description } = options; const fetchOptions: RequestInit = { method: 'POST', @@ -176,7 +176,7 @@ export function createPublishGiteaAction(options: { sourcePath, } = ctx.input; - const { owner, repo, host } = parseRepoUrl(repoUrl, integrations); + const { repo, host } = parseRepoUrl(repoUrl, integrations); const integrationConfig = integrations.gitea.byHost(host); if (!integrationConfig) { @@ -199,7 +199,7 @@ export function createPublishGiteaAction(options: { await createGiteaProject(integrationConfig.config, { description, - owner: owner, + // owner: owner, projectName: repo, // parent: workspace, });