From 29a689f6b405154e57eb80385eb76d0dd70c2074 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 13:41:56 -0800 Subject: [PATCH 1/2] add release to valid pr types --- .github/actions/conventional-pr/src/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/conventional-pr/src/utils.ts b/.github/actions/conventional-pr/src/utils.ts index fbcbc1f77b..169c749c19 100644 --- a/.github/actions/conventional-pr/src/utils.ts +++ b/.github/actions/conventional-pr/src/utils.ts @@ -14,6 +14,7 @@ const validTypes = [ 'ci', 'chore', 'revert', + 'release', ]; const typeList = validTypes.map(t => ` - ${t}`).join('\n'); From c1e009c8df878356d482346145eb5227b1939ca4 Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Thu, 21 Nov 2019 13:45:25 -0800 Subject: [PATCH 2/2] add more info to error messages --- .github/actions/conventional-pr/src/utils.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/actions/conventional-pr/src/utils.ts b/.github/actions/conventional-pr/src/utils.ts index 169c749c19..5e76cc4f11 100644 --- a/.github/actions/conventional-pr/src/utils.ts +++ b/.github/actions/conventional-pr/src/utils.ts @@ -29,22 +29,25 @@ export function validateTitle(title: string): ValidationResult { const hastype = validTypes.some(t => title.startsWith(`${t}: `)); if (!hastype) { - core.info( - `[Title] Missing type in title. Choose from the following:\n${typeList}` + errors.push( + `[Title] Must start with type (ex. 'feat: ').\nThe valid types are:\n${typeList}` ); - errors.push("[Title] Must start with type. i.e. 'feat: '"); } return errors; } const refMatch = /(refs?|close(d|s)?|fix(ed|es)?) \#\d+/i; +const helpLink = + 'https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords'; export function validateBody(body: string): ValidationResult { let errors: ValidationResult = []; if (!refMatch.test(body)) { - errors.push('[Body] Must reference an issue.'); + errors.push( + `[Body] Must reference an issue (ex. 'fixes #1234').\nSee ${helpLink} for more details.` + ); } return errors;