Skip to content

Commit 16aba24

Browse files
authored
Update ReadMe for Release Notes Generation Script (#14989)
1 parent 270f785 commit 16aba24

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Update ReadMe for Release Notes Generation Script",
4+
"packageName": "@rnw-scripts/generate-release-notes",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/@rnw-scripts/generate-release-notes/ReadMe.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,21 @@ or at least repo:status, repo_deployment, public_repo (for public repos)
2929
- Click that button to authorize the token with the organization.
3030
- Copy the generated token
3131

32-
#### 2. Set env variables at root of the repo
32+
#### 2. Set variables as params and run "yarn release-notes"
3333

3434
```
35-
set GITHUB_TOKEN=<your-personal-access-token>
36-
set RELEASE_TAG=0.80.0
37-
set START_DATE=2025-06-01
38-
set END_DATE=2025-07-16
39-
35+
Usage:
36+
yarn release-notes --token <GITHUB_TOKEN> --start <START_DATE> --end <END_DATE> [--repo <OWNER/REPO>] [--tag <RELEASE_TAG>]
37+
38+
Options:
39+
--token (required) GitHub personal access token.
40+
--start (required) Start date in YYYY-MM-DD.
41+
--end (required) End date in YYYY-MM-DD.
42+
--repo Repository in OWNER/REPO format. Default: microsoft/react-native-windows
43+
--tag Release tag label. Default: Unreleased. Expected: 0.80 or similar
44+
--help Show this help message.
4045
```
41-
#### 3. Run "`yarn release-notes`" at the root of the repo
4246

43-
#### 4. You will see a release-notes.md file generated at packages\@rnw-scripts\generate-release-notes\release_notes.md which will have all the data you need.
47+
#### 3. You will see a release-notes.md file generated at packages\@rnw-scripts\generate-release-notes\release_notes.md which will have all the data you need.
48+
49+
#### 4. Verify the release notes generated from all commits section and delete the "All Commits" and "Excluded" sections after validation

packages/@rnw-scripts/generate-release-notes/generate-release-notes.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ function shouldIncludeInReleaseNotes(prDescription) {
189189
if (lines.length === 0) return false;
190190

191191
// Check if the first non-empty line contains "no" or "_no_"
192-
const firstLine = lines[0].toLowerCase();
193-
return !(firstLine.includes('no') || firstLine.includes('_no_'));
192+
const firstLine = lines[0].toLowerCase().trim();
193+
return !(firstLine === 'no' || firstLine === '_no_');
194194
}
195195

196196
function extractReleaseNotesSummary(prDescription) {
@@ -270,7 +270,8 @@ function extractTypeOfChange(prDescription) {
270270

271271
async function categorizeCommits(commits) {
272272
const categories = {
273-
'All Commits': [],
273+
'All Commits [REVIEW ONLY]': [],
274+
'Excluded [REVIEW ONLY]': [],
274275
'Breaking Changes': [],
275276
'New Features': [],
276277
'Reliability': [],
@@ -331,14 +332,16 @@ async function categorizeCommits(commits) {
331332
console.log(`PR #${prNumber}: Type of Change = "${typeOfChange}", Category = "${category}"`);
332333
} else {
333334
console.log(`Skipping PR #${prNumber} - not marked for inclusion in release notes`);
335+
const excluded = `- ${commitTitle} [${commitTitle} · ${REPO}@${sha} (github.com)](${url})`;
336+
categories['Excluded [REVIEW ONLY]'].push(excluded);
334337
continue; // Skip this commit
335338
}
336339
}
337340
}
338341

339342
const entry = `- ${summary} [${commitTitle} · ${REPO}@${sha} (github.com)](${url})`;
340343

341-
categories['All Commits'].push(entry);
344+
categories['All Commits [REVIEW ONLY]'].push(entry);
342345
categories[category].push(entry);
343346
}
344347

0 commit comments

Comments
 (0)