feat(catalog-import): make catalog import branch name customizable

Signed-off-by: Mikko Korhonen <mikko.korhonen@gmail.com>
This commit is contained in:
Mikko Korhonen
2022-01-13 12:30:39 +02:00
parent 1bd29cd9ae
commit 307f17372e
4 changed files with 12 additions and 1 deletions
+1
View File
@@ -196,6 +196,7 @@ integrations:
catalog:
import:
entityFilename: catalog-info.yaml
pullRequestBranchName: backstage-integration
rules:
- allow:
- Component
@@ -82,6 +82,7 @@ scaffolder:
catalog:
import:
entityFilename: catalog-info.yaml
pullRequestBranchName: backstage-integration
rules:
- allow: [Component, System, API, Group, User, Resource, Location]
locations:
+7
View File
@@ -28,6 +28,13 @@ export interface Config {
* @visibility frontend
*/
entityFilename?: string;
/**
* A branch name used in pull request when registering existing component via UI
* Valid git refname required, see: https://git-scm.com/docs/git-check-ref-format
* Defaults to "backstage-integration"
* @visibility frontend
*/
pullRequestBranchName?: string;
};
};
}
@@ -303,7 +303,9 @@ the component will become available.\n\nFor more information, read an \
baseUrl: githubIntegrationConfig.apiBaseUrl,
});
const branchName = 'backstage-integration';
const branchName =
this.configApi.getOptionalString('catalog.pullRequestBranchName') ??
'backstage-integration';
const fileName =
this.configApi.getOptionalString('catalog.import.entityFilename') ??
'catalog-info.yaml';