diff --git a/.changeset/wet-vans-drive.md b/.changeset/wet-vans-drive.md index 903e32209e..a61c764122 100644 --- a/.changeset/wet-vans-drive.md +++ b/.changeset/wet-vans-drive.md @@ -1,5 +1,7 @@ --- '@backstage/plugin-scaffolder-backend': minor +'@backstage/plugin-catalog-backend-module-github': patch +'@backstage/integration': patch --- -Add support for Repository Variables and Secrets to the `publish:github` and `github:repo:create` scaffolder actions. +Add support for Repository Variables and Secrets to the `publish:github` and `github:repo:create` scaffolder actions. Upgrade octokit introduces some breaking changes. diff --git a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts index 402a62d97c..dc3a86b72b 100644 --- a/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts +++ b/packages/integration/src/github/SingleInstanceGithubCredentialsProvider.ts @@ -174,8 +174,10 @@ class GithubAppManager { const allInstallations = await this.getInstallations(); const installation = allInstallations.find( inst => - inst.account?.login?.toLocaleLowerCase('en-US') === - owner.toLocaleLowerCase('en-US'), + inst.account && + 'login' in inst.account && + inst.account.login?.toLocaleLowerCase('en-US') === + owner.toLocaleLowerCase('en-US'), ); if (installation) { return { diff --git a/plugins/catalog-backend-module-github/src/processors/GithubMultiOrgReaderProcessor.ts b/plugins/catalog-backend-module-github/src/processors/GithubMultiOrgReaderProcessor.ts index 9709977010..cf5e484fc2 100644 --- a/plugins/catalog-backend-module-github/src/processors/GithubMultiOrgReaderProcessor.ts +++ b/plugins/catalog-backend-module-github/src/processors/GithubMultiOrgReaderProcessor.ts @@ -233,6 +233,7 @@ export class GithubMultiOrgReaderProcessor implements CatalogProcessor { .map(install => install.target_type === 'Organization' && install.account && + 'login' in install.account && install.account.login ? { name: install.account.login, diff --git a/plugins/catalog-backend-module-github/src/providers/GithubMultiOrgEntityProvider.ts b/plugins/catalog-backend-module-github/src/providers/GithubMultiOrgEntityProvider.ts index 51796c2116..9ac9f2c45d 100644 --- a/plugins/catalog-backend-module-github/src/providers/GithubMultiOrgEntityProvider.ts +++ b/plugins/catalog-backend-module-github/src/providers/GithubMultiOrgEntityProvider.ts @@ -838,6 +838,7 @@ export class GithubMultiOrgEntityProvider implements EntityProvider { .map(install => install.target_type === 'Organization' && install.account && + 'login' in install.account && install.account.login ? install.account.login : undefined, diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 11d5208f37..103ae6d1fd 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -87,7 +87,7 @@ "morgan": "^1.10.0", "node-fetch": "^2.6.7", "nunjucks": "^3.2.3", - "octokit": "^2.0.5", + "octokit": "^2.0.0", "octokit-plugin-create-pull-request": "^3.10.0", "p-limit": "^3.1.0", "p-queue": "^6.6.2", diff --git a/yarn.lock b/yarn.lock index 420185ec81..4f9c03518b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8263,7 +8263,7 @@ __metadata: msw: ^1.0.0 node-fetch: ^2.6.7 nunjucks: ^3.2.3 - octokit: ^2.0.5 + octokit: ^2.0.0 octokit-plugin-create-pull-request: ^3.10.0 p-limit: ^3.1.0 p-queue: ^6.6.2 @@ -32189,7 +32189,7 @@ __metadata: languageName: node linkType: hard -"octokit@npm:^2.0.4, octokit@npm:^2.0.5": +"octokit@npm:^2.0.0, octokit@npm:^2.0.4": version: 2.0.18 resolution: "octokit@npm:2.0.18" dependencies: