- 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:
Mike Penz
2023-11-05 10:05:00 +00:00
committed by GitHub
parent e86f2bbfce
commit 8afbd5a789
19 changed files with 1145 additions and 4267 deletions
+9 -1
View File
@@ -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].