Merge pull request #9346 from djamaile/master
fix(scaffolder-backend): use the right key when initializing a Gitlab…
This commit is contained in:
@@ -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 {
|
||||
|
||||
+2
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user