File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import bcd from "@mdn/browser-compat-data" with { type: 'json' };
44import { Octokit } from "@octokit/rest" ;
55import { throttling } from "@octokit/plugin-throttling" ;
66
7+ const dryRun = process . argv . includes ( "--dry-run" ) ;
8+
79// A special comment in the issue body is used to store the web-features
810// ID, <!-- web-features:some-feature -->. Whitespace is allowed wherever
911// possible to make the matching less brittle to changes.
@@ -169,6 +171,10 @@ async function update() {
169171 if ( issue . title !== title || issue . body !== body ) {
170172 // Update the issue. This might happen as a result of a change in
171173 // web-features or if we change the format of the issue body.
174+ if ( dryRun ) {
175+ console . log ( `Dry run. Would update issue for ${ id } .` ) ;
176+ continue ;
177+ }
172178 console . log ( `Updating issue for ${ id } .` ) ;
173179 await octokit . rest . issues . update ( {
174180 ...params ,
@@ -179,6 +185,10 @@ async function update() {
179185 }
180186 } else {
181187 // Create a new issue.
188+ if ( dryRun ) {
189+ console . log ( `Dry run. Would create new issue for ${ id } .` ) ;
190+ continue ;
191+ }
182192 console . log ( `Creating new issue for ${ id } .` ) ;
183193 await octokit . rest . issues . create ( {
184194 ...params ,
You can’t perform that action at this time.
0 commit comments