Default created entities to using the first listed CODEOWNER as owner.

Co-authored-by: Jonatan Dahl <jd@spotify.com>
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2023-08-21 09:48:49 +02:00
parent d4e9ae07f8
commit 0109d3f111
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/repo-tools': patch
---
The `generate-catalog-info` command now uses the first listed `CODEOWNER` as Component owner when initially
creating the `catalog-info.yaml` file. It continues to allow any one listed `CODEOWNER` when updating
entity metadata.
@@ -59,7 +59,7 @@ export function getOwnerFromCodeowners(
): string {
const relPath = relativePath('.', absPath);
const possibleOwners = getPossibleCodeowners(codeowners, relPath);
const owner = possibleOwners.slice(-1)[0];
const owner = possibleOwners[0];
if (!owner) {
throw new Error(`${relPath} isn't owned by anyone in CODEOWNERS`);