Merge pull request #3969 from titilambert/fix_gitlab_publisher

Fix gitlab scaffoler publisher
This commit is contained in:
Ben Lambert
2021-01-08 19:49:40 +01:00
committed by GitHub
3 changed files with 11 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': minor
---
Fix gitlab scaffolder publisher
@@ -51,7 +51,7 @@ describe('GitLab Publisher', () => {
const result = await publisher.publish({
values: {
isOrg: true,
storePath: 'blam/test',
storePath: 'bloum/blam/test',
owner: 'bob',
},
directory: '/tmp/test',
@@ -82,7 +82,7 @@ describe('GitLab Publisher', () => {
const result = await publisher.publish({
values: {
storePath: 'blam/test',
storePath: 'bloum/blam/test',
owner: 'bob',
},
directory: '/tmp/test',
@@ -52,7 +52,10 @@ export class GitlabPublisher implements PublisherBase {
private async createRemote(
values: RequiredTemplateValues & Record<string, JsonValue>,
) {
const [owner, name] = values.storePath.split('/');
const pathElements = values.storePath.split('/');
const name = pathElements[pathElements.length - 1];
pathElements.pop();
const owner = pathElements.join('/');
let targetNamespace = ((await this.client.Namespaces.show(owner)) as {
id: number;