Skip to content

Commit

Permalink
Merge pull request #2785 from uselagoon/double_dash_project_names
Browse files Browse the repository at this point in the history
Adding check for double dashes in new project names
  • Loading branch information
bomoko committed Aug 20, 2021
2 parents e3d4155 + 1ee7144 commit 257f9a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/api/src/resources/project/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ export const addProject = async (
'Only lowercase characters, numbers and dashes allowed for name!'
);
}
if (validator.matches(input.name, /--/)) {
throw new Error(
'Multiple consecutive dashes are not allowed for name!'
);
}
if (!isValidGitUrl(input.gitUrl)) {
throw new Error('The provided gitUrl is invalid.');
}
Expand Down

0 comments on commit 257f9a0

Please sign in to comment.