diff --git a/.changeset/thirty-plums-shout.md b/.changeset/thirty-plums-shout.md index 5b5ffad6a9..56ac640326 100644 --- a/.changeset/thirty-plums-shout.md +++ b/.changeset/thirty-plums-shout.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend': patch --- -Added a regex test to check commit hash.If url is from git commit branch ignore the edit url. +Added a regex test to check commit hash. If url is from git commit branch ignore the edit url. diff --git a/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts b/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts index f46f5cfd42..00864b69e7 100644 --- a/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts +++ b/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts @@ -31,6 +31,7 @@ import { CatalogProcessorEmit, } from '@backstage/plugin-catalog-node'; +const commitHashRegExp = /\b[0-9a-f]{40,}\b/; /** @public */ export class AnnotateLocationEntityProcessor implements CatalogProcessor { constructor( @@ -53,7 +54,6 @@ export class AnnotateLocationEntityProcessor implements CatalogProcessor { let viewUrl; let editUrl; let sourceLocation; - const commitHashRegExp = /\b[0-9a-f]{40,}\b/; if (location.type === 'url') { const scmIntegration = integrations.byUrl(location.target);