@@ -34,19 +34,19 @@ function getCodeQLCliVersionForRelease(release): string {
3434 }
3535 return cliVersionsFromMarkerFiles [ 0 ] ;
3636 }
37-
37+
3838 async function getBundleInfoFromRelease ( release ) : Promise < BundleInfo > {
3939 return {
4040 bundleVersion : release . tag_name . substring ( CODEQL_BUNDLE_PREFIX . length ) ,
4141 cliVersion : getCodeQLCliVersionForRelease ( release )
4242 } ;
4343 }
44-
44+
4545 async function getNewDefaults ( currentDefaults : Defaults ) : Promise < Defaults > {
4646 const release = github . context . payload . release ;
4747 console . log ( 'Updating default bundle as a result of the following release: ' +
4848 `${ JSON . stringify ( release ) } .` )
49-
49+
5050 const bundleInfo = await getBundleInfoFromRelease ( release ) ;
5151 return {
5252 bundleVersion : bundleInfo . bundleVersion ,
@@ -55,14 +55,15 @@ function getCodeQLCliVersionForRelease(release): string {
5555 priorCliVersion : currentDefaults . cliVersion
5656 } ;
5757 }
58-
58+
5959 async function main ( ) {
6060 const previousDefaults : Defaults = JSON . parse ( fs . readFileSync ( '../../../src/defaults.json' , 'utf8' ) ) ;
6161 const newDefaults = await getNewDefaults ( previousDefaults ) ;
62+ // Update the source file in the repository. Calling workflows should subsequently rebuild
63+ // the Action to update `lib/defaults.json`.
6264 fs . writeFileSync ( '../../../src/defaults.json' , JSON . stringify ( newDefaults , null , 2 ) + "\n" ) ;
6365 }
64-
66+
6567 // Ideally, we'd await main() here, but that doesn't work well with `ts-node`.
6668 // So instead we rely on the fact that Node won't exit until the event loop is empty.
6769 main ( ) ;
68-
0 commit comments