From 2b2fdccaa68bdb98826bce846d272574a35e0510 Mon Sep 17 00:00:00 2001 From: cmoulliard Date: Thu, 4 Jan 2024 19:15:53 +0100 Subject: [PATCH] Fixing the issue about the branch name not included to the url converted. Wrong: "https://localhost:3333/api/v1/repos/org1/repo1/contents/?ref=catalog-info.yaml" and good: "https://localhost:3333/api/v1/repos/org1/repo1/contents/catalog-info.yaml?ref=maincatalog-info.yaml" Signed-off-by: cmoulliard --- plugins/scaffolder-backend-module-gitea/README.md | 2 -- plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitea/README.md b/plugins/scaffolder-backend-module-gitea/README.md index 6b42eca9d0..4a710a400c 100644 --- a/plugins/scaffolder-backend-module-gitea/README.md +++ b/plugins/scaffolder-backend-module-gitea/README.md @@ -48,8 +48,6 @@ integrations: **NOTE**: As backstage will issue HTTPS/TLS requests to the gitea instance, it is needed to configure `gitea` with a valid certificate or at least with a self-signed certificate `gitea cert --host localhost -ca`. Don't forget to set the env var `NODE_EXTRA_CA_CERTS` to point to the CA pem file before to launch backstage ! -**WARNING**: Please pass the branch name part of the `catalogInfoPath` for the action `register` till we will fix this issue (e.g `main/catalog-info.yaml`) ! - When done, you can use the action in your template: ```yaml diff --git a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts index b8ab703460..7905f42e4a 100644 --- a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts +++ b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts @@ -31,6 +31,7 @@ import { examples } from './gitea.examples'; import fetch, { RequestInit, Response } from 'node-fetch'; import crypto from 'crypto'; +/* NOT USED. See TODO hereafter const checkGiteaOrgRepo = async ( config: GiteaIntegrationConfig, options: { @@ -61,6 +62,8 @@ const checkGiteaOrgRepo = async ( } return response; }; +*/ + const checkGiteaOrg = async ( config: GiteaIntegrationConfig, options: { @@ -330,7 +333,7 @@ export function createPublishGiteaAction(options: { */ await sleep(3000); - const repoContentsUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}/src/branch/${defaultBranch}`; + const repoContentsUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}/src/branch/${defaultBranch}/`; ctx.output('remoteUrl', remoteUrl); ctx.output('commitHash', commitResult?.commitHash); ctx.output('repoContentsUrl', repoContentsUrl);