Skip to content

Commit

Permalink
Merge pull request #5185 from backstage/blam/fix-github-apps-auth
Browse files Browse the repository at this point in the history
Fix GitHubApp URL parsing so we can get a token
  • Loading branch information
benjdlambert committed Mar 31, 2021
2 parents d53d01d + 77893b6 commit 39f4128
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/warm-keys-yell.md
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---

Fix a bug with GitHub Apps support not parsing the URL correctly
Expand Up @@ -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) {
Expand Down

0 comments on commit 39f4128

Please sign in to comment.