@@ -10,6 +10,9 @@ const EDGE_OT_PAGE = `${EDGE_OT_ROOT}/microsoft-edge/origin-trials/trials`;
10
10
// If Beta becomes stable within the next N coming days, generate the release notes for Canary.
11
11
// This way, the release notes are ready for when Canary becomes Beta.
12
12
const DAYS_NUMBER_BEFORE_RELNOTES_NOTICE = 15 ;
13
+ // The Git branch name where the release notes will be generated.
14
+ // Keep this in sync with thge webplat-releasenotes.yaml workflow file.
15
+ const BRANCH_NAME = "web-platform-release-notes" ;
13
16
14
17
async function fetchChromeStatusAPI ( url ) {
15
18
const response = await fetch ( url ) ;
@@ -28,6 +31,14 @@ function longDate(dateString) {
28
31
} ) ;
29
32
}
30
33
34
+ function getReleaseNoteMDFilePath ( version ) {
35
+ return `https://github.com/MicrosoftDocs/edge-developer/blob/${ BRANCH_NAME } /microsoft-edge/web-platform/release-notes/${ version } .md` ;
36
+ }
37
+
38
+ function getReleaseNoteRawMDFilePath ( version ) {
39
+ return `https://raw.githubusercontent.com/MicrosoftDocs/edge-developer/refs/heads/${ BRANCH_NAME } /microsoft-edge/web-platform/release-notes/${ version } .md` ;
40
+ }
41
+
31
42
async function getActiveEdgeOTs ( ) {
32
43
const scrapingBrowser = await playwright . chromium . launch ( { headless : true } ) ;
33
44
const context = await scrapingBrowser . newContext ( ) ;
@@ -152,7 +163,17 @@ async function main() {
152
163
) ;
153
164
154
165
// --------------------------------------------------
155
- // 2. Fetch Chrome Status features for the N+1 milestone.
166
+ // 2. Check if there isn't already a release notes draft for the next beta version.
167
+ // --------------------------------------------------
168
+
169
+ const rawFileResponse = await fetch ( getReleaseNoteRawMDFilePath ( nextBetaVersion ) ) ;
170
+ if ( rawFileResponse . status === 200 ) {
171
+ console . error ( `A PR is already open for the next beta release notes. File exists: ${ getReleaseNoteMDFilePath ( nextBetaVersion ) } .` ) ;
172
+ process . exit ( 0 ) ;
173
+ }
174
+
175
+ // --------------------------------------------------
176
+ // 3. Fetch Chrome Status features for the N+1 milestone.
156
177
// --------------------------------------------------
157
178
158
179
console . log (
@@ -164,7 +185,7 @@ async function main() {
164
185
const csFeatures = csMilestoneData . features_by_type ;
165
186
166
187
// --------------------------------------------------
167
- // 3 . Fetch Chrome Status new origin trials in N+1.
188
+ // 4 . Fetch Chrome Status new origin trials in N+1.
168
189
// --------------------------------------------------
169
190
170
191
console . log (
@@ -190,7 +211,7 @@ async function main() {
190
211
} ) ;
191
212
192
213
// --------------------------------------------------
193
- // 4 . Fetch current Edge origin trials.
214
+ // 5 . Fetch current Edge origin trials.
194
215
// --------------------------------------------------
195
216
196
217
console . log (
@@ -199,7 +220,7 @@ async function main() {
199
220
const edgeOTs = await getActiveEdgeOTs ( ) ;
200
221
201
222
// --------------------------------------------------
202
- // 5 . Generate the release notes draft content.
223
+ // 6 . Generate the release notes draft content.
203
224
// --------------------------------------------------
204
225
// Write the fetched data locally for 11ty to use, run 11ty, and then delete the file.
205
226
@@ -252,7 +273,7 @@ async function main() {
252
273
await fs . rmdir ( "_data" , { recursive : true , force : true } ) ;
253
274
254
275
// --------------------------------------------------
255
- // 6 . Write the release notes draft content to a file.
276
+ // 7 . Write the release notes draft content to a file.
256
277
// --------------------------------------------------
257
278
// All release notes go into /microsoft-edge/web-platform/release-notes/.
258
279
// The file name should be the next beta version number.
@@ -262,12 +283,12 @@ async function main() {
262
283
await fs . writeFile ( releaseNotesPath , releaseNotesContent ) ;
263
284
264
285
// --------------------------------------------------
265
- // 7 . Open an issue on the repo to notify the team about the new release notes draft.
286
+ // 8 . Open an issue on the repo to notify the team about the new release notes draft.
266
287
// --------------------------------------------------
267
288
268
289
console . log ( "Opening an issue to notify the team about the new release notes draft." ) ;
269
- const title = `New beta web platform release notes for ${ nextBetaVersion } ` ;
270
- const body = `The release notes draft for the next beta version ${ nextBetaVersion } has been generated in [${ releaseNotesPath } ](${ releaseNotesPath } ) on the web-platform-release-notes branch.\n\nPlease update the content as needed.` ;
290
+ const title = `Microsoft Edge Beta ${ nextBetaVersion } web platform release notes ready for review ` ;
291
+ const body = `The release notes draft for the next Microsoft Edge beta version ${ nextBetaVersion } has been generated in [${ nextBetaVersion } .md ](${ getReleaseNoteMDFilePath ( nextBetaVersion ) } ) on the ${ BRANCH_NAME } branch.\n\nPlease [create a pull request](https://github.com/MicrosoftDocs/edge-developer/compare/main... ${ BRANCH_NAME } ), update the content as needed, and close this issue .` ;
271
292
272
293
const octokit = github . getOctokit ( process . env . token ) ;
273
294
const { data : issue } = await octokit . rest . issues . create ( {
0 commit comments