gh processor passes over repos without default branch
Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-backend': patch
|
||||
---
|
||||
|
||||
GitHub discovery processor passes over repositories that do not have a default branch
|
||||
@@ -108,9 +108,15 @@ export class GithubDiscoveryProcessor implements CatalogProcessor {
|
||||
);
|
||||
|
||||
for (const repository of matching) {
|
||||
const path = `/blob/${
|
||||
branch === '-' ? repository.defaultBranchRef.name : branch
|
||||
}${catalogPath}`;
|
||||
const branchName = branch === '-' ? repository.defaultBranchRef?.name : branch;
|
||||
|
||||
if (!branchName) {
|
||||
this.logger.info(`the repository ${repository.url} does not have a default branch, skipping`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const path = `/blob/${branchName}${catalogPath}`;
|
||||
|
||||
emit(
|
||||
results.location(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user