1+ import process from "process" ;
12import applicationinsights = require( "applicationinsights" ) ;
23import * as yargs from "yargs" ;
34
4- import { defaultLocalOptions } from "./lib/common" ;
5+ import { defaultLocalOptions , defaultRemoteOptions } from "./lib/common" ;
56import { publishNotNeededPackage , publishTypingsPackage } from "./lib/package-publisher" ;
67import { getDefinitelyTyped , AllPackages } from "@definitelytyped/definitions-parser" ;
78import {
@@ -19,7 +20,10 @@ import { getSecret, Secret } from "./lib/secrets";
1920if ( ! module . parent ) {
2021 const dry = ! ! yargs . argv . dry ;
2122 logUncaughtErrors ( async ( ) => {
22- const dt = await getDefinitelyTyped ( defaultLocalOptions , loggerWithErrors ( ) [ 0 ] ) ;
23+ const dt = await getDefinitelyTyped (
24+ process . env . GITHUB_ACTIONS ? defaultRemoteOptions : defaultLocalOptions ,
25+ loggerWithErrors ( ) [ 0 ]
26+ ) ;
2327 await publishPackages (
2428 await readChangedPackages ( await AllPackages . read ( dt ) ) ,
2529 dry ,
@@ -42,7 +46,7 @@ export default async function publishPackages(
4246 log ( "=== Publishing packages ===" ) ;
4347 }
4448
45- const client = await NpmPublishClient . create ( await getSecret ( Secret . NPM_TOKEN ) , undefined ) ;
49+ const client = await NpmPublishClient . create ( dry ? "" : await getSecret ( Secret . NPM_TOKEN ) , undefined ) ;
4650
4751 for ( const cp of changedPackages . changedTypings ) {
4852 log ( `Publishing ${ cp . pkg . desc } ...` ) ;
0 commit comments