Skip to content

Commit 397557b

Browse files
nzakasaladdin-add
andauthored
Fix: Omit sponsors sync from changelog (#53)
* Fix: Make npm install work * Fix: Omit Sponsors Syncs from changelog (fixes #50) * Update .eslintrc.yml Co-authored-by: 薛定谔的猫 <[email protected]> Co-authored-by: 薛定谔的猫 <[email protected]>
1 parent a968dff commit 397557b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.eslintrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
env:
22
node: true
33
extends: "eslint-config-eslint"
4+
parserOptions:
5+
ecmaVersion: 2021
46
rules:
57
no-console: 0
68
require-unicode-regexp: 0

lib/release-ops.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function parseLogs(logs) {
157157
* @param {Object[]} logs An array of parsed commit log messages.
158158
* @returns {Object[]} An array of parsed commit log messages.
159159
*/
160-
function excludeReverts(logs) {
160+
function excludeRevertsAndSponsorSyncs(logs) {
161161
const newLogs = logs.slice();
162162

163163
const revertRegex = /This reverts commit ([0-9a-f]{40})/,
@@ -178,6 +178,8 @@ function excludeReverts(logs) {
178178
newLogs[shaIndexMap[sha]] = null;
179179
newLogs[i] = null;
180180
}
181+
} else if (/^Sponsors: Sync/.test(log.title)) {
182+
newLogs[i] = null;
181183
} else {
182184
shaIndexMap[log.sha] = i;
183185
}
@@ -197,7 +199,7 @@ function excludeReverts(logs) {
197199
*/
198200
function calculateReleaseFromGitLogs(currentVersion, logs, prereleaseId) {
199201

200-
const excludedLogs = excludeReverts(parseLogs(logs));
202+
const excludedLogs = excludeRevertsAndSponsorSyncs(parseLogs(logs));
201203

202204
const changelog = {},
203205
repository = getPackageInfo().repository;

tests/lib/release-ops.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,16 @@ describe("ReleaseOps", () => {
179179
});
180180
});
181181

182-
it("should disregard reverted commits", () => {
182+
it("should disregard reverted commits and sponsor syncs", () => {
183183
const logs = [
184184
"* 34d6f550b2c87e61a70cb201abd3eadebb370453 Docs: Update something in the docs (githubhandle)",
185185
"This is the body.",
186186
"It has multiple lines.",
187187
"* 5c5c361cc338d284cac6d170ab7e105e213e1307 Revert \"Breaking: A breaking change (fixes #1234)\" (Committer Name)",
188188
"This reverts commit 00a3526f3a6560e4f91d390725b9a70f5d974f89.",
189189
"This explains why.",
190+
"* bcdc618488d12184e32a7ba170b443450c3e9e4a Sponsors: Sync README with website (Abc D. Efg)",
191+
"Describe the bug.",
190192
"* bcdc618488d12184e32a7ba170b443450c3e9e48 Fix: Fix a bug (fixes #4321) (Abc D. Efg)",
191193
"Describe the bug.",
192194
"* 7e4ffad5c91e4f8a99a95955ec65c5dbe9ae1758 Revert \"New: Add cool new feature (fixes #42)\" (Tina Tester)",

0 commit comments

Comments
 (0)