diff --git a/src/components/common/ArtifactForm.tsx b/src/components/common/ArtifactForm.tsx index be879b92d..814f3bd07 100644 --- a/src/components/common/ArtifactForm.tsx +++ b/src/components/common/ArtifactForm.tsx @@ -19,6 +19,7 @@ import { Input } from "../ui/input"; import Callout from "./Callout"; import { validateArtifactNameAgainstPurlSpec } from "../../utils/common"; +import { documentationLinks } from "@/const/documentationLinks"; import { Alert, AlertDescription } from "../ui/alert"; interface Props { @@ -41,7 +42,11 @@ const ArtifactForm = ({ form, isEditMode = false }: Props) => { + !value?.includes("@") || "You shall not enter a version/branch", + }} render={({ field }) => ( Artifact Name @@ -76,6 +81,21 @@ const ArtifactForm = ({ form, isEditMode = false }: Props) => { {"). Any Qualifiers can be added straight to the artifact name."} + {field.value?.includes("@") && ( +

+ DevGuard automatically appends the branch or version (the ref) + to the artifact name, so adding it here yourself causes a + duplicated reference (e.g. @main@main).{" "} + + Learn why + + . +

+ )}
)} /> diff --git a/src/const/documentationLinks.ts b/src/const/documentationLinks.ts index 6e535615f..9e9af69cc 100644 --- a/src/const/documentationLinks.ts +++ b/src/const/documentationLinks.ts @@ -7,6 +7,8 @@ export const documentationLinks = { "https://devguard.org/explanations/compliance/csaf-vex-explained", artifactExplaining: "https://devguard.org/explanations/core-concepts/artifacts", + artifactVersioning: + "https://docs.devguard.org/how-to-guides/scanning/branches-tags-and-artifacts/", acceptRisk: "https://devguard.org/explanations/vulnerability-management/vulnerability-events#4-accept-risk", riskCalculation: