Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
fix: update unrecognized error message (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslafy-z authored Feb 13, 2023
1 parent 664a3a3 commit b9d8aa3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/validateTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ module.exports = async function validateTitle(preset, title) {
const { parserOpts } = conventionalChangelogConfig;
const result = parser(title, parserOpts);

const allowedTypes = Object.keys(conventionalCommitTypes.types);

if (!result.type) {
throw new Error(
`No release type found in pull request title "${title}".` +
'\n\nAdd a prefix like "fix: ", "feat: " or "feat!: " to indicate what kind of release this pull request corresponds to. The title should match the commit mesage format as specified by https://www.conventionalcommits.org/.'
`No release type found in pull request title "${title}". The title should match the commit message format as specified by https://www.conventionalcommits.org/. The functionalities can also be altered by the selected preset plugin (${preset}). ` +
`\n\nPlease use one of these recognized types: ${allowedTypes.join(
', '
)}.`
);
}

const allowedTypes = Object.keys(conventionalCommitTypes.types);
if (!allowedTypes.includes(result.type)) {
throw new Error(
`Unknown release type "${result.type}" found in pull request title "${title}".` +
Expand Down

0 comments on commit b9d8aa3

Please sign in to comment.