Signed-off-by: Kiss Miklos <miklos@roadie.io>
This commit is contained in:
Kiss Miklos
2022-09-27 15:49:01 +02:00
parent 421b620af3
commit 48117acb8c
@@ -51,15 +51,6 @@ export class RepoLocationAnalyzer implements LocationAnalyzer {
) as GitHubIntegration;
const { owner, name } = parseGitUrl(request.location.target);
const entity: Entity = {
apiVersion: 'backstage.io/v1alpha1',
kind: 'Component',
metadata: {
name: name,
},
spec: { type: 'other', lifecycle: 'unknown' },
};
let annotationPrefix;
let analyzer;
switch (integration?.type) {
@@ -98,6 +89,15 @@ export class RepoLocationAnalyzer implements LocationAnalyzer {
}
}
const entity: Entity = {
apiVersion: 'backstage.io/v1alpha1',
kind: 'Component',
metadata: {
name: name,
},
spec: { type: 'other', lifecycle: 'unknown' },
};
if (annotationPrefix) {
entity.metadata.annotations = {
[`${annotationPrefix}/project-slug`]: `${owner}/${name}`,