catalog-import: replace trailing slash regexp with trimEnd
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-4
@@ -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>
|
||||
}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user