@@ -50,6 +50,16 @@ const DEFAULT_DISTRIBUTION_OWNER_NAME = "github";
5050 */
5151const DEFAULT_DISTRIBUTION_REPOSITORY_NAME = "codeql-cli-binaries" ;
5252
53+ /**
54+ * Owner name of the nightly version of the extension-managed distribution on GitHub.
55+ */
56+ const NIGHTLY_DISTRIBUTION_OWNER_NAME = "dsp-testing" ;
57+
58+ /**
59+ * Repository name of the nightly version of the extension-managed distribution on GitHub.
60+ */
61+ const NIGHTLY_DISTRIBUTION_REPOSITORY_NAME = "codeql-cli-nightlies" ;
62+
5363/**
5464 * Range of versions of the CLI that are compatible with the extension.
5565 *
@@ -476,19 +486,33 @@ class ExtensionSpecificDistributionManager {
476486 }
477487
478488 private createReleasesApiConsumer ( ) : ReleasesApiConsumer {
479- const ownerName = this . config . ownerName
480- ? this . config . ownerName
481- : DEFAULT_DISTRIBUTION_OWNER_NAME ;
482- const repositoryName = this . config . repositoryName
483- ? this . config . repositoryName
484- : DEFAULT_DISTRIBUTION_REPOSITORY_NAME ;
485489 return new ReleasesApiConsumer (
486- ownerName ,
487- repositoryName ,
490+ this . distributionOwnerName ( ) ,
491+ this . distributionRepositoryName ( ) ,
488492 this . config . personalAccessToken ,
489493 ) ;
490494 }
491495
496+ private distributionOwnerName ( ) : string {
497+ if ( this . config . ownerName ) {
498+ return this . config . ownerName ;
499+ } else if ( this . config . channel === "nightly" ) {
500+ return NIGHTLY_DISTRIBUTION_OWNER_NAME ;
501+ } else {
502+ return DEFAULT_DISTRIBUTION_OWNER_NAME ;
503+ }
504+ }
505+
506+ private distributionRepositoryName ( ) : string {
507+ if ( this . config . repositoryName ) {
508+ return this . config . repositoryName ;
509+ } else if ( this . config . channel === "nightly" ) {
510+ return NIGHTLY_DISTRIBUTION_REPOSITORY_NAME ;
511+ } else {
512+ return DEFAULT_DISTRIBUTION_REPOSITORY_NAME ;
513+ }
514+ }
515+
492516 private async bumpDistributionFolderIndex ( ) : Promise < void > {
493517 const index = this . extensionContext . globalState . get (
494518 ExtensionSpecificDistributionManager . _currentDistributionFolderIndexStateKey ,
0 commit comments