Skip to content

Commit 4003f7e

Browse files
authored
meta: Fix changelog script (#12069)
Actually we should check for the changelog commit, which we look for by checking `-meta` and `changelog` in the commit message. (Not perfect, but good enough hopefully...) I noticed it was not correctly picking up all commits while a release was in progress before.
1 parent 4a1f2ac commit 4003f7e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/get-commit-list.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ import { execSync } from 'child_process';
33
function run(): void {
44
const commits = execSync('git log --format="- %s"').toString().split('\n');
55

6-
const lastReleasePos = commits.findIndex(commit => commit.includes("Merge branch 'release"));
6+
const lastReleasePos = commits.findIndex(commit => /- meta(.*)changelog/i.test(commit));
77

88
const newCommits = commits.splice(0, lastReleasePos).filter(commit => {
9-
// Filter out master/develop merges
10-
if (/Merge pull request #(\d+) from getsentry\/(master|develop)/.test(commit)) {
9+
// Filter out merge commits
10+
if (/Merge pull request/.test(commit)) {
11+
return false;
12+
}
13+
// Filter release branch merged
14+
if (/Merge branch/.test(commit)) {
15+
return false;
16+
}
17+
// Filter release commit itself
18+
if (/release:/.test(commit)) {
1119
return false;
1220
}
1321

0 commit comments

Comments
 (0)