Skip to content

Commit 9f7e0af

Browse files
committed
Add registries to the init status complete report
Registries might require authentication, before we add it to the report we remove any credentials.
1 parent 25d2596 commit 9f7e0af

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/config-utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,13 @@ function parseRegistries(
881881
}
882882
}
883883

884+
export function parseRegistriesWithoutCredentials(registriesInput?: string) : RegistryConfigNoCredentials[] | undefined {
885+
return parseRegistries(registriesInput)?.map((r) => {
886+
const {token:_, ...registryWithoutCredentials} = r;
887+
return registryWithoutCredentials;
888+
})
889+
}
890+
884891
function isLocal(configPath: string): boolean {
885892
// If the path starts with ./, look locally
886893
if (configPath.indexOf("./") === 0) {

src/init-action.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ interface InitWithConfigStatusReport extends InitStatusReport {
9393
trap_cache_download_size_bytes: number;
9494
/** Time taken to download TRAP caches, in milliseconds. */
9595
trap_cache_download_duration_ms: number;
96+
/** Stringified JSON array of registry configuration objects, from the 'registries' config field or workflow input. **/
97+
registries: string;
9698
/** Stringified JSON object representing a query-filters, from the 'query-filters' config field. **/
9799
query_filters: string;
98100
}
@@ -210,6 +212,7 @@ async function sendCompletedStatusReport(
210212
),
211213
trap_cache_download_duration_ms: Math.round(config.trapCacheDownloadTime),
212214
query_filters: JSON.stringify(config.originalUserInput["query-filters"]),
215+
registries: JSON.stringify(configUtils.parseRegistriesWithoutCredentials(getOptionalInput("registries"))),
213216
};
214217
await sendStatusReport({
215218
...initWithConfigStatusReport,

0 commit comments

Comments
 (0)