Merge pull request #5185 from backstage/blam/fix-github-apps-auth

Fix GitHubApp URL parsing so we can get a token
This commit is contained in:
Ben Lambert
2021-03-31 14:15:57 +02:00
committed by GitHub
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Fix a bug with GitHub Apps support not parsing the URL correctly
@@ -102,8 +102,12 @@ export function createPublishGithubAction(options: {
);
}
// TODO(blam): Consider changing this API to have owner, repo interface instead of URL as the it's
// needless to create URL and then parse again the other side.
const { token } = await credentialsProvider.getCredentials({
url: `${host}/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`,
url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(
repo,
)}`,
});
if (!token) {