1
+ import * as process from "process" ;
1
2
import applicationinsights = require( "applicationinsights" ) ;
2
3
import * as yargs from "yargs" ;
3
4
4
- import { defaultLocalOptions } from "./lib/common" ;
5
+ import { defaultLocalOptions , defaultRemoteOptions } from "./lib/common" ;
5
6
import { deprecateNotNeededPackage , publishNotNeededPackage , publishTypingsPackage } from "./lib/package-publisher" ;
6
7
import { getDefinitelyTyped , AllPackages } from "@definitelytyped/definitions-parser" ;
7
8
import {
@@ -23,7 +24,10 @@ if (!module.parent) {
23
24
const dry = ! ! yargs . argv . dry ;
24
25
const deprecateName = yargs . argv . deprecate as string | undefined ;
25
26
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
+ ) ;
27
31
if ( deprecateName !== undefined ) {
28
32
// A '--deprecate' command is available in case types-publisher got stuck *while* trying to deprecate a package.
29
33
// Normally this should not be needed.
@@ -59,7 +63,7 @@ export default async function publishPackages(
59
63
log ( "=== Publishing packages ===" ) ;
60
64
}
61
65
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 ) ;
63
67
64
68
for ( const cp of changedPackages . changedTypings ) {
65
69
log ( `Publishing ${ cp . pkg . desc } ...` ) ;
0 commit comments