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 {
@@ -23,7 +24,10 @@ if (!module.parent) {
2324 const dry = ! ! yargs . argv . dry ;
2425 const deprecateName = yargs . argv . deprecate as string | undefined ;
2526 logUncaughtErrors ( async ( ) => {
26- const dt = await getDefinitelyTyped ( defaultLocalOptions , loggerWithErrors ( ) [ 0 ] ) ;
27+ const dt = await getDefinitelyTyped (
28+ process . env . GITHUB_ACTIONS ? defaultRemoteOptions : defaultLocalOptions ,
29+ loggerWithErrors ( ) [ 0 ]
30+ ) ;
2731 if ( deprecateName !== undefined ) {
2832 // A '--deprecate' command is available in case types-publisher got stuck *while* trying to deprecate a package.
2933 // Normally this should not be needed.
@@ -59,7 +63,7 @@ export default async function publishPackages(
5963 log ( "=== Publishing packages ===" ) ;
6064 }
6165
62- const client = await NpmPublishClient . create ( await getSecret ( Secret . NPM_TOKEN ) , undefined ) ;
66+ const client = await NpmPublishClient . create ( dry ? "" : await getSecret ( Secret . NPM_TOKEN ) , undefined ) ;
6367
6468 for ( const cp of changedPackages . changedTypings ) {
6569 log ( `Publishing ${ cp . pkg . desc } ...` ) ;
0 commit comments