Skip to content

Commit acd6429

Browse files
authored
fix: dont allow release-please to update workspace changelogs (#398)
1 parent 3e9444e commit acd6429

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

lib/release/node-workspace-format.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,6 @@ module.exports = class extends ManifestPlugin {
5353
return `${link(scope, url)}: ${wrapSpecs(`${name}@${version}`)}`
5454
})
5555

56-
// remove the other release please dependencies list which always starts with
57-
// the following line and then each line is indented. so we search for the line
58-
// and remove and indented lines until the next non indented line.
59-
let foundRemoveStart = false
60-
let foundRemoveEnd = false
61-
release.notes = release.notes
62-
.split('\n')
63-
.filter((line) => {
64-
if (line === '* The following workspace dependencies were updated') {
65-
foundRemoveStart = true
66-
} else if (foundRemoveStart && !foundRemoveEnd) {
67-
// TODO: test when inserted dependencies is not the last thing in the changelog
68-
/* istanbul ignore next */
69-
if (!line || !line.startsWith(' ')) {
70-
foundRemoveEnd = true
71-
}
72-
}
73-
// If we found the start, remove all lines until we've found the end
74-
return foundRemoveStart ? foundRemoveEnd : true
75-
})
76-
.join('\n')
77-
7856
// Find the associated changelog and update that too
7957
const path = this.#pathsByComponent.get(release.component)
8058
for (const update of candidate.pullRequest.updates) {

lib/release/node-workspace.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ const { WORKSPACE_MESSAGE } = require('./node-workspace-format')
1212
// release-please ourselves.
1313
/* istanbul ignore next: TODO fix flaky tests and enable coverage */
1414
class NpmNodeWorkspace extends NodeWorkspace {
15+
updateCandidate (pr) {
16+
// no-op so release-please node-workspace plugin does not add
17+
// its broken changelog to the workspace releases. our changelog
18+
// formatting and the preconfigure method below fix this.
19+
return pr
20+
}
21+
1522
async preconfigure (strategiesByPath, commitsByPath, releasesByPath) {
1623
// First build a list of all releases that will happen based on the
1724
// conventional commits

0 commit comments

Comments
 (0)