diff --git a/plugins/scaffolder-backend-module-gitea/README.md b/plugins/scaffolder-backend-module-gitea/README.md index 9d733e76ff..6b42eca9d0 100644 --- a/plugins/scaffolder-backend-module-gitea/README.md +++ b/plugins/scaffolder-backend-module-gitea/README.md @@ -48,6 +48,8 @@ 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 @@ -147,7 +149,7 @@ spec: action: catalog:register input: repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} - catalogInfoPath: '/catalog-info.yaml' + catalogInfoPath: 'main/catalog-info.yaml' output: links: diff --git a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts index 50b215f7d8..76ddb189a6 100644 --- a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts +++ b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts @@ -302,6 +302,16 @@ export function createPublishGiteaAction(options: { gitAuthorInfo, }); + /* + TODO: This code is commented till it will be fixed. + When we use the code hereafter, we got the following error: + "Unable to read url, Error: Unknown encoding: undefined\n at DefaultLocationService.processEntities" + as commented here: Still getting the error: https://github.com/backstage/backstage/pull/21890#issuecomment-1876733870 + + Such an issue do not exist using sleep 3s. + + WARNING: To allow to register within the catalog the new project, it is also needed to pass within the catalogInfoPath the branch name (e.g: main/catalog-info.yaml) + // Check if the repo is available let response: Response; response = await checkGiteaOrgRepo(integrationConfig.config, { @@ -317,6 +327,8 @@ export function createPublishGiteaAction(options: { defaultBranch, }); } + */ + await sleep(3000); const repoContentsUrl = `${integrationConfig.config.baseUrl}/${owner}/${repo}/+/refs/${defaultBranch}`; ctx.output('remoteUrl', remoteUrl);