Merge pull request #9346 from djamaile/master

fix(scaffolder-backend): use the right key when initializing a Gitlab…
This commit is contained in:
Ben Lambert
2022-02-05 22:02:00 +01:00
committed by GitHub
3 changed files with 10 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
fix for the `gitlab:publish` action to use the `oauthToken` key when creating a
`Gitlab` client. This only happens if `ctx.input.token` is provided else the key `token` will be used.
@@ -112,10 +112,11 @@ export function createPublishGitlabAction(options: {
}
const token = ctx.input.token || integrationConfig.config.token!;
const tokenType = ctx.input.token ? 'oauthToken' : 'token';
const client = new Gitlab({
host: integrationConfig.config.baseUrl,
token,
[tokenType]: token,
});
let { id: targetNamespace } = (await client.Namespaces.show(owner)) as {
@@ -118,10 +118,11 @@ export const createPublishGitlabMergeRequestAction = (options: {
}
const token = ctx.input.token ?? integrationConfig.config.token!;
const tokenType = ctx.input.token ? 'oauthToken' : 'token';
const api = new Gitlab({
host: integrationConfig.config.baseUrl,
token,
[tokenType]: token,
});
const fileRoot = ctx.workspacePath;