Skip to content

Commit 04cc956

Browse files
chore: Release 4.1.0 [skip ci]
1 parent f1216e9 commit 04cc956

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [4.1.0](https://github.com/amannn/action-semantic-pull-request/compare/v4.0.1...v4.1.0) (2022-02-04)
4+
5+
6+
### Features
7+
8+
* 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))
9+
310
### [4.0.1](https://github.com/amannn/action-semantic-pull-request/compare/v4.0.0...v4.0.1) (2022-02-03)
411

512

dist/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35745,6 +35745,14 @@ module.exports = async function run() {
3574535745
`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.`
3574635746
);
3574735747
}
35748+
35749+
const commitTitle =
35750+
nonMergeCommits[0].commit.message.split('\n')[0];
35751+
if (commitTitle !== pullRequest.title) {
35752+
throw new Error(
35753+
`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.`
35754+
);
35755+
}
3574835756
}
3574935757
}
3575035758
} catch (error) {

0 commit comments

Comments
 (0)