From 04cc956a3601c765333cbd1c08e137120df96b81 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 4 Feb 2022 16:52:18 +0000 Subject: [PATCH] chore: Release 4.1.0 [skip ci] --- CHANGELOG.md | 7 +++++++ dist/index.js | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2da419bbc..5bf0fe749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.1.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.0.1...v4.1.0) (2022-02-04) + + +### Features + +* Check if the PR title matches the commit title when single commits are validated to avoid surprises ([#158](https://github.com/amannn/action-semantic-pull-request/issues/158)) ([f1216e9](https://github.com/amannn/action-semantic-pull-request/commit/f1216e9607ae4b476a6584a899c39bbb4f62da6d)) + ### [4.0.1](https://github.com/amannn/action-semantic-pull-request/compare/v4.0.0...v4.0.1) (2022-02-03) diff --git a/dist/index.js b/dist/index.js index aae533f3c..c13fd8700 100644 --- a/dist/index.js +++ b/dist/index.js @@ -35745,6 +35745,14 @@ module.exports = async function run() { `Pull request has only one commit and it's not semantic; this may lead to a non-semantic commit in the base branch (see https://github.community/t/how-to-change-the-default-squash-merge-commit-message/1155). Amend the commit message to match the pull request title, or add another commit.` ); } + + const commitTitle = + nonMergeCommits[0].commit.message.split('\n')[0]; + if (commitTitle !== pullRequest.title) { + throw new Error( + `The pull request has only one (non-merge) commit and in this case Github will use it as the default commit message when merging. The pull request title doesn't match the commit though ("${pullRequest.title}" vs. "${commitTitle}"). Please update the pull request title accordingly to avoid surprises.` + ); + } } } } catch (error) {