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 { deprecateNotNeededPackage , publishNotNeededPackage , publishTypingsPackage } from "./lib/package-publisher" ;
67import { getDefinitelyTyped , AllPackages } from "@definitelytyped/definitions-parser" ;
78import {
@@ -20,7 +21,10 @@ if (!module.parent) {
2021 const dry = ! ! yargs . argv . dry ;
2122 const deprecateName = yargs . argv . deprecate as string | undefined ;
2223 logUncaughtErrors ( async ( ) => {
23- const dt = await getDefinitelyTyped ( defaultLocalOptions , loggerWithErrors ( ) [ 0 ] ) ;
24+ const dt = await getDefinitelyTyped (
25+ process . env . GITHUB_ACTIONS ? defaultRemoteOptions : defaultLocalOptions ,
26+ loggerWithErrors ( ) [ 0 ]
27+ ) ;
2428 if ( deprecateName !== undefined ) {
2529 // A '--deprecate' command is available in case types-publisher got stuck *while* trying to deprecate a package.
2630 // Normally this should not be needed.
@@ -56,7 +60,7 @@ export default async function publishPackages(
5660 log ( "=== Publishing packages ===" ) ;
5761 }
5862
59- const client = await NpmPublishClient . create ( await getSecret ( Secret . NPM_TOKEN ) , undefined ) ;
63+ const client = await NpmPublishClient . create ( dry ? "" : await getSecret ( Secret . NPM_TOKEN ) , undefined ) ;
6064
6165 for ( const cp of changedPackages . changedTypings ) {
6266 log ( `Publishing ${ cp . pkg . desc } ...` ) ;
0 commit comments