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 { publishNotNeededPackage , publishTypingsPackage } from "./lib/package-publisher" ;
6
7
import { getDefinitelyTyped , AllPackages } from "@definitelytyped/definitions-parser" ;
7
8
import {
@@ -19,7 +20,10 @@ import { getSecret, Secret } from "./lib/secrets";
19
20
if ( ! module . parent ) {
20
21
const dry = ! ! yargs . argv . dry ;
21
22
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
+ ) ;
23
27
await publishPackages (
24
28
await readChangedPackages ( await AllPackages . read ( dt ) ) ,
25
29
dry ,
@@ -42,7 +46,7 @@ export default async function publishPackages(
42
46
log ( "=== Publishing packages ===" ) ;
43
47
}
44
48
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 ) ;
46
50
47
51
for ( const cp of changedPackages . changedTypings ) {
48
52
log ( `Publishing ${ cp . pkg . desc } ...` ) ;
0 commit comments