Bug
Setting "pull-request-header": "" in release-please-config.json does not remove the default header. The PR body still contains :robot: I have created a release *beep* *boop*.
Root cause
In src/util/pull-request-body.ts, the constructor uses || for both header and footer:
this.header = options?.header || DEFAULT_HEADER;
this.footer = options?.footer || DEFAULT_FOOTER;
Since empty string is falsy in JavaScript, "" || DEFAULT_HEADER evaluates to DEFAULT_HEADER. These should use nullish coalescing (??) to only fall back for null/undefined:
this.header = options?.header ?? DEFAULT_HEADER;
this.footer = options?.footer ?? DEFAULT_FOOTER;
Steps to reproduce
- Set
"pull-request-header": "" and/or "pull-request-footer": "" in release-please-config.json
- Run release-please to create/update a release PR
- Observe the PR body still contains the default header/footer
Expected behavior
An empty string should be respected as an intentional override, producing no header/footer.
Bug
Setting
"pull-request-header": ""inrelease-please-config.jsondoes not remove the default header. The PR body still contains:robot: I have created a release *beep* *boop*.Root cause
In
src/util/pull-request-body.ts, the constructor uses||for both header and footer:Since empty string is falsy in JavaScript,
"" || DEFAULT_HEADERevaluates toDEFAULT_HEADER. These should use nullish coalescing (??) to only fall back fornull/undefined:Steps to reproduce
"pull-request-header": ""and/or"pull-request-footer": ""inrelease-please-config.jsonExpected behavior
An empty string should be respected as an intentional override, producing no header/footer.