Skip to content

Commit addf27c

Browse files
committed
actually add the sript lol
1 parent 0a83e38 commit addf27c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

scripts/get-commit-list.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { execSync } from "child_process";
2+
3+
function run(): void {
4+
const commits = execSync('git log --format="- %s"').toString().split("\n");
5+
6+
const lastReleasePos = commits.findIndex((commit) => /- meta(.*)changelog/i.test(commit));
7+
8+
const newCommits = commits.splice(0, lastReleasePos).filter((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)) {
19+
return false;
20+
}
21+
22+
return true;
23+
});
24+
25+
newCommits.sort((a, b) => a.localeCompare(b));
26+
27+
const issueUrl = "https://github.com/getsentry/sentry-javascript-bundler-plugins/pull/";
28+
const newCommitsWithLink = newCommits.map((commit) =>
29+
commit.replace(/#(\d+)/, `[#$1](${issueUrl}$1)`)
30+
);
31+
32+
// eslint-disable-next-line no-console
33+
console.log(newCommitsWithLink.join("\n"));
34+
}
35+
36+
run();

0 commit comments

Comments
 (0)