@@ -97935,7 +97935,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
97935
97935
return (mod && mod.__esModule) ? mod : { "default": mod };
97936
97936
};
97937
97937
Object.defineProperty(exports, "__esModule", ({ value: true }));
97938
- exports.cacheDependencies = void 0;
97939
97938
const core = __importStar(__nccwpck_require__(7484));
97940
97939
const finder = __importStar(__nccwpck_require__(6843));
97941
97940
const finderPyPy = __importStar(__nccwpck_require__(2625));
@@ -97954,50 +97953,10 @@ function isGraalPyVersion(versionSpec) {
97954
97953
function cacheDependencies(cache, pythonVersion) {
97955
97954
return __awaiter(this, void 0, void 0, function* () {
97956
97955
const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined;
97957
- let resolvedDependencyPath = undefined;
97958
- if (cacheDependencyPath) {
97959
- const actionPath = process.env.GITHUB_ACTION_PATH || '';
97960
- const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
97961
- const sourcePath = path.resolve(actionPath, cacheDependencyPath);
97962
- const relativePath = path.relative(actionPath, sourcePath);
97963
- const targetPath = path.resolve(workspace, relativePath);
97964
- try {
97965
- const sourceExists = yield fs_1.default.promises
97966
- .access(sourcePath, fs_1.default.constants.F_OK)
97967
- .then(() => true)
97968
- .catch(() => false);
97969
- if (!sourceExists) {
97970
- core.warning(`The resolved cache-dependency-path does not exist: ${sourcePath}`);
97971
- }
97972
- else {
97973
- if (sourcePath !== targetPath) {
97974
- const targetDir = path.dirname(targetPath);
97975
- // Create target directory if it doesn't exist
97976
- yield fs_1.default.promises.mkdir(targetDir, { recursive: true });
97977
- // Copy file asynchronously
97978
- yield fs_1.default.promises.copyFile(sourcePath, targetPath);
97979
- core.info(`Copied ${sourcePath} to ${targetPath}`);
97980
- }
97981
- else {
97982
- core.info(`Dependency file is already inside the workspace: ${sourcePath}`);
97983
- }
97984
- resolvedDependencyPath = path
97985
- .relative(workspace, targetPath)
97986
- .replace(/\\/g, '/');
97987
- core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
97988
- }
97989
- }
97990
- catch (error) {
97991
- core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`);
97992
- }
97993
- }
97994
- // Pass resolvedDependencyPath if available, else fallback to original input
97995
- const dependencyPathForCache = resolvedDependencyPath !== null && resolvedDependencyPath !== void 0 ? resolvedDependencyPath : cacheDependencyPath;
97996
- const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, dependencyPathForCache);
97956
+ const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, cacheDependencyPath);
97997
97957
yield cacheDistributor.restoreCache();
97998
97958
});
97999
97959
}
98000
- exports.cacheDependencies = cacheDependencies;
98001
97960
function resolveVersionInputFromDefaultFile() {
98002
97961
const couples = [
98003
97962
['.python-version', utils_1.getVersionsInputFromPlainFile]
0 commit comments