From 6090563d91619262c7b43438e28b5ad501c45d6e Mon Sep 17 00:00:00 2001 From: Aparna Jyothi Date: Mon, 9 Jun 2025 13:20:47 +0530 Subject: [PATCH] documentation update --- dist/setup/index.js | 14 ++++++++------ docs/advanced-usage.md | 2 +- src/setup-python.ts | 16 +++++++++------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index f699ef89..9c4cb00a 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -96934,12 +96934,14 @@ function cacheDependencies(cache, pythonVersion) { core.warning(`The resolved cache-dependency-path does not exist: ${sourcePath}`); } else { - try { - fs_1.default.copyFileSync(sourcePath, targetPath); - core.info(`Copied ${sourcePath} to ${targetPath}`); - } - catch (error) { - core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`); + if (sourcePath !== targetPath) { + try { + fs_1.default.copyFileSync(sourcePath, targetPath); + core.info(`Copied ${sourcePath} to ${targetPath}`); + } + catch (error) { + core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`); + } } } resolvedDependencyPath = path.relative(workspace, targetPath); diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 459ef5e3..4353b341 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -411,7 +411,7 @@ steps: - run: pip install -e . # Or pip install -e '.[test]' to install test dependencies ``` -Note : cache-dependency-path supports files located outside the workspace root by copying them into the workspace to enable proper caching. +Note: cache-dependency-path supports files located outside the workspace root by copying them into the workspace to enable proper caching. # Outputs and environment variables ## Outputs diff --git a/src/setup-python.ts b/src/setup-python.ts index 1dcd9f47..06682b79 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -42,13 +42,15 @@ export async function cacheDependencies(cache: string, pythonVersion: string) { `The resolved cache-dependency-path does not exist: ${sourcePath}` ); } else { - try { - fs.copyFileSync(sourcePath, targetPath); - core.info(`Copied ${sourcePath} to ${targetPath}`); - } catch (error) { - core.warning( - `Failed to copy file from ${sourcePath} to ${targetPath}: ${error}` - ); + if (sourcePath !== targetPath) { + try { + fs.copyFileSync(sourcePath, targetPath); + core.info(`Copied ${sourcePath} to ${targetPath}`); + } catch (error) { + core.warning( + `Failed to copy file from ${sourcePath} to ${targetPath}: ${error}` + ); + } } }