mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 02:16:45 +00:00
suggest users to run without daemon if fail to save Gradle cache on Windows
This commit is contained in:
parent
7fe6c4d631
commit
fae2927552
3 changed files with 51 additions and 0 deletions
16
dist/cleanup/index.js
vendored
16
dist/cleanup/index.js
vendored
|
@ -64623,12 +64623,28 @@ function save(id) {
|
|||
core.info(error.message);
|
||||
}
|
||||
else {
|
||||
if (isProbablyGradleDaemonProblem(packageManager, error)) {
|
||||
core.warning('Failed to save Gradle cache on Windows. If tar.exe reported "Permission denied", try to run Gradle with `--no-daemon` option. Refer to https://github.com/actions/cache/issues/454 for detail.');
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.save = save;
|
||||
/**
|
||||
* @param packageManager the specified package manager by user
|
||||
* @param error the error thrown by the saveCache
|
||||
* @returns true if the given error seems related to the {@link https://github.com/actions/cache/issues/454|running Gradle Daemon issue}.
|
||||
* @see {@link https://github.com/actions/cache/issues/454#issuecomment-840493935|why --no-daemon is necessary}
|
||||
*/
|
||||
function isProbablyGradleDaemonProblem(packageManager, error) {
|
||||
if (packageManager.id !== 'gradle' || process.env['RUNNER_OS'] !== 'Windows') {
|
||||
return false;
|
||||
}
|
||||
const message = error.message || '';
|
||||
return message.startsWith('Tar failed with error: ');
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue