catalog-import: replace trailing slash regexp with trimEnd

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2021-10-07 09:21:00 +02:00
parent 1a26a18f7f
commit 05e835b9f1
2 changed files with 3 additions and 4 deletions
+1
View File
@@ -4,6 +4,7 @@
'@backstage/integration': patch
'@backstage/plugin-catalog-backend-module-ldap': patch
'@backstage/plugin-catalog-backend-module-msgraph': patch
'@backstage/plugin-catalog-import': patch
---
Replace slash stripping regexp with trimEnd to remove CodeQL warning
@@ -19,6 +19,7 @@ import { Card, CardContent, CardHeader } from '@material-ui/core';
import React from 'react';
import YAML from 'yaml';
import { CodeSnippet } from '@backstage/core-components';
import { trimEnd } from 'lodash';
type Props = {
repositoryUrl: string;
@@ -35,10 +36,7 @@ export const PreviewCatalogInfoComponent = ({
<Card variant="outlined" className={classes?.card}>
<CardHeader
title={
<code>{`${repositoryUrl.replace(
/[\/]*$/,
'',
)}/catalog-info.yaml`}</code>
<code>{`${trimEnd(repositoryUrl, '/')}/catalog-info.yaml`}</code>
}
/>