Skip to content

Commit

Permalink
Add registries to the init status complete report
Browse files Browse the repository at this point in the history
Registries might require authentication, before we add it to the
report we remove any credentials.
  • Loading branch information
Remco Vermeulen committed Jul 26, 2024
1 parent 25d2596 commit 9f7e0af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,13 @@ function parseRegistries(
}
}

export function parseRegistriesWithoutCredentials(registriesInput?: string) : RegistryConfigNoCredentials[] | undefined {
return parseRegistries(registriesInput)?.map((r) => {
const {token:_, ...registryWithoutCredentials} = r;
return registryWithoutCredentials;
})
}

function isLocal(configPath: string): boolean {
// If the path starts with ./, look locally
if (configPath.indexOf("./") === 0) {
Expand Down
3 changes: 3 additions & 0 deletions src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ interface InitWithConfigStatusReport extends InitStatusReport {
trap_cache_download_size_bytes: number;
/** Time taken to download TRAP caches, in milliseconds. */
trap_cache_download_duration_ms: number;
/** Stringified JSON array of registry configuration objects, from the 'registries' config field or workflow input. **/
registries: string;
/** Stringified JSON object representing a query-filters, from the 'query-filters' config field. **/
query_filters: string;
}
Expand Down Expand Up @@ -210,6 +212,7 @@ async function sendCompletedStatusReport(
),
trap_cache_download_duration_ms: Math.round(config.trapCacheDownloadTime),
query_filters: JSON.stringify(config.originalUserInput["query-filters"]),
registries: JSON.stringify(configUtils.parseRegistriesWithoutCredentials(getOptionalInput("registries"))),
};
await sendStatusReport({
...initWithConfigStatusReport,
Expand Down

0 comments on commit 9f7e0af

Please sign in to comment.