diff --git a/lib/actions/pullRequest.js b/lib/actions/pullRequest.js index 0cbf9c5f..06800aed 100644 --- a/lib/actions/pullRequest.js +++ b/lib/actions/pullRequest.js @@ -35,7 +35,7 @@ exports.validatePR = async function validatePR({ pullRequest, issue }) { if (!isBranchNameValid(headRef)) { throw new Error( - `This pull request is based on a branch with in invalid name: “${headRef}”. See https://www.notion.so/mobsuccess/Git-Guidelines-41996ef576cb4f29b7737772b74289c5#f9cadc10d949498dbe38c0eed08fd4f8` + `This pull request is based on a branch with in invalid name: “${headRef}”. See https://github.com/mobsuccess-devops/rfc/blob/master/docs/decisions/0009-convention-nommage-branch-pr.md and https://www.notion.so/mobsuccess/Git-Guidelines-41996ef576cb4f29b7737772b74289c5#f9cadc10d949498dbe38c0eed08fd4f8` ); } diff --git a/lib/branch.js b/lib/branch.js index 63bc100e..428ce16b 100644 --- a/lib/branch.js +++ b/lib/branch.js @@ -1,5 +1,13 @@ function isBranchNameValid(branchName) { return ( + // The following are the older branch prefixes, that are still valid, with + // discussions pending on the ADR #9 with a PR #35 still active at the time + // of writing, to maybe deprecate them. In the meantime we still have to + // allow branches using these prefixes, as no active ADR disallows their + // use. + !!branchName.match( + /^(core|feature|fix|hotfix|asset|rework|documentation)\/([a-z][a-z0-9._-]*)$/ + ) || !!branchName.match( /^(feat|fix|chore|docs|refactor|test|revert|ci|perf|style|build|change|remove|poc|mobsuccessbot|dependabot)\/([a-z][a-z0-9._-]*)$/ ) ||