diff --git a/CHANGELOG.md b/CHANGELOG.md index 7387d8cab..5f5c29319 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [3.4.3](https://github.com/amannn/action-semantic-pull-request/compare/v3.4.2...v3.4.3) (2021-10-26) + + +### Bug Fixes + +* Consider merge commits for single commit validation ([#127](https://github.com/amannn/action-semantic-pull-request/issues/127)) ([1b347f7](https://github.com/amannn/action-semantic-pull-request/commit/1b347f79d6518f5d0190913abf7815286f490f53)), closes [#108](https://github.com/amannn/action-semantic-pull-request/issues/108) [#108](https://github.com/amannn/action-semantic-pull-request/issues/108) + ### [3.4.2](https://github.com/amannn/action-semantic-pull-request/compare/v3.4.1...v3.4.2) (2021-08-16) diff --git a/dist/index.js b/dist/index.js index 5ed2f0263..2f3e97077 100644 --- a/dist/index.js +++ b/dist/index.js @@ -33345,7 +33345,17 @@ module.exports = async function run() { per_page: 2 }); - if (commits.length === 1) { + // GitHub does not count merge commits when deciding whether to use + // the PR title or a commit message for the squash commit message. + const nonMergeCommits = commits.filter( + (commit) => !commit.message.startsWith('Merge branch') + ); + + // If there is only one (non merge) commit present, GitHub will use + // that commit rather than the PR title for the title of a squash + // commit. To make sure a semantic title is used for the squash + // commit, we need to validate the commit title. + if (nonMergeCommits.length === 1) { try { await validatePrTitle(commits[0].commit.message, { types,