File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,13 @@ function uploadToDatadog(
8888 sites : string [ ]
8989) : void {
9090 for ( const site of sites ) {
91- if ( ! site ) {
92- printLog ( `No source maps upload configured for ${ site } , skipping...` )
91+ const apiKey = getTelemetryOrgApiKey ( site )
92+
93+ if ( ! apiKey ) {
94+ printLog ( `No API key configured for ${ site } , skipping...` )
9395 continue
9496 }
97+
9598 printLog ( `Uploading ${ packageName } source maps with prefix ${ prefix } for ${ site } ...` )
9699
97100 command `
@@ -103,7 +106,7 @@ function uploadToDatadog(
103106 --repository-url https://www.github.com/datadog/browser-sdk
104107 `
105108 . withEnvironment ( {
106- DATADOG_API_KEY : getTelemetryOrgApiKey ( site ) ,
109+ DATADOG_API_KEY : apiKey ,
107110 DATADOG_SITE : site ,
108111 } )
109112 . run ( )
Original file line number Diff line number Diff line change @@ -42,14 +42,22 @@ export function getOrg2AppKey(): string {
4242 return getSecretKey ( 'ci.browser-sdk.datadog_ci_application_key' )
4343}
4444
45- export function getTelemetryOrgApiKey ( site : string ) : string {
45+ export function getTelemetryOrgApiKey ( site : string ) : string | undefined {
4646 const normalizedSite = site . replaceAll ( '.' , '-' )
47- return getSecretKey ( `ci.browser-sdk.source-maps.${ normalizedSite } .ci_api_key` )
47+ try {
48+ return getSecretKey ( `ci.browser-sdk.source-maps.${ normalizedSite } .ci_api_key` )
49+ } catch {
50+ return
51+ }
4852}
4953
50- export function getTelemetryOrgApplicationKey ( site : string ) : string {
54+ export function getTelemetryOrgApplicationKey ( site : string ) : string | undefined {
5155 const normalizedSite = site . replaceAll ( '.' , '-' )
52- return getSecretKey ( `ci.browser-sdk.telemetry.${ normalizedSite } .ci_app_key` )
56+ try {
57+ return getSecretKey ( `ci.browser-sdk.telemetry.${ normalizedSite } .ci_app_key` )
58+ } catch {
59+ return
60+ }
5361}
5462
5563export function getNpmToken ( ) : string {
You can’t perform that action at this time.
0 commit comments