1
+ import 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 {
@@ -20,7 +21,10 @@ if (!module.parent) {
20
21
const dry = ! ! yargs . argv . dry ;
21
22
const deprecateName = yargs . argv . deprecate as string | undefined ;
22
23
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
+ ) ;
24
28
if ( deprecateName !== undefined ) {
25
29
// A '--deprecate' command is available in case types-publisher got stuck *while* trying to deprecate a package.
26
30
// Normally this should not be needed.
@@ -56,7 +60,7 @@ export default async function publishPackages(
56
60
log ( "=== Publishing packages ===" ) ;
57
61
}
58
62
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 ) ;
60
64
61
65
for ( const cp of changedPackages . changedTypings ) {
62
66
log ( `Publishing ${ cp . pkg . desc } ...` ) ;
0 commit comments