Added check of 'process.env.UV_CACHE_DIR' to resolve linter warning

This commit is contained in:
James Braza 2025-10-02 08:12:45 -07:00
parent bd651064f0
commit e381565822

View file

@ -53,11 +53,11 @@ async function saveCache(): Promise<void> {
}
let actualCachePath = cacheLocalPath;
if (process.env.UV_CACHE_DIR !== cacheLocalPath) {
if (process.env.UV_CACHE_DIR && process.env.UV_CACHE_DIR !== cacheLocalPath) {
core.warning(
`The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${cacheLocalPath}".`,
);
actualCachePath = process.env.UV_CACHE_DIR!;
actualCachePath = process.env.UV_CACHE_DIR;
}
core.info(`Saving cache path: ${actualCachePath}`);