chore: parse the URL to get the resource in the gitlab preparer for now

This commit is contained in:
blam
2021-01-14 13:17:38 +01:00
parent 2244bc1934
commit 5224a49a26
@@ -20,6 +20,8 @@ import { Config, JsonValue } from '@backstage/config';
import { Logger } from 'winston';
import { initRepoAndPush } from './helpers';
import { RequiredTemplateValues } from '../templater';
import gitUrlParse from 'git-url-parse';
import {
GitLabIntegrationConfig,
readGitLabIntegrationConfigs,
@@ -116,7 +118,9 @@ export class GitlabPublisher implements PublisherBase {
pathElements.pop();
const owner = pathElements.join('/');
const config = this.getConfig();
const { resource: host } = gitUrlParse(values.storePath);
const config = this.getConfig(host);
if (!config.token) {
throw new Error(