From 94d393b414a10f2ace8e4375ab05883cb35491f7 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 31 Mar 2021 13:51:31 +0200 Subject: [PATCH 1/3] bug: git-url-parse needs https prefix otherwise it fails to parse. Lovely. Signed-off-by: blam --- .../src/scaffolder/actions/builtin/publish/github.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts index 808d76c8cf..1eff8eb7e2 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts @@ -103,7 +103,9 @@ export function createPublishGithubAction(options: { } const { token } = await credentialsProvider.getCredentials({ - url: `${host}/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`, + url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent( + repo, + )}`, }); if (!token) { From 164cc4c5334f4ed08e64e120289ced83460e642b Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 31 Mar 2021 13:55:24 +0200 Subject: [PATCH 2/3] chore: changeset Signed-off-by: blam --- .changeset/warm-keys-yell.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/warm-keys-yell.md diff --git a/.changeset/warm-keys-yell.md b/.changeset/warm-keys-yell.md new file mode 100644 index 0000000000..b50b775de1 --- /dev/null +++ b/.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 From 77893b657a7c4c0d231bd0c4bd9d4ba07b6e0177 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 31 Mar 2021 13:58:35 +0200 Subject: [PATCH 3/3] chore: add todo for later refactor Signed-off-by: blam --- .../src/scaffolder/actions/builtin/publish/github.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts index 1eff8eb7e2..7ade6ffd19 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.ts @@ -102,6 +102,8 @@ 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: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent( repo,