- fix formatting
- apply some smaller fixes - enable cache for 1 gitea test (no need to use API) - do not cache and export token in cache - speed up main.test.ts
This commit is contained in:
+9
-1
@@ -41,13 +41,21 @@ export function writeCacheData(data: Data, cacheOutput: string | null): void {
|
||||
}
|
||||
|
||||
try {
|
||||
fs.writeFileSync(cacheFile, JSON.stringify(data))
|
||||
// use replacer to not cache the repositoryUtils (as that would contain token information)
|
||||
fs.writeFileSync(cacheFile, JSON.stringify(data, replacer))
|
||||
core.setOutput(`cache`, cacheFile)
|
||||
} catch (error) {
|
||||
core.warning(`Failed to write cache file. (${error})`)
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function replacer(key: string, value: any): any {
|
||||
if (key === 'repositoryUtils') return undefined
|
||||
if (key === 'token') return undefined
|
||||
else return value
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the exported information from a previous run of the `release-changelog-builder-action`.
|
||||
* If available, return a [ReleaseNotesData].
|
||||
|
||||
Reference in New Issue
Block a user