Compare commits

..

2 Commits

Author SHA1 Message Date
Sergey Dolin
a8a1cb527e
Merge 55bf2e2f65 into db8764c1e2 2023-07-25 17:38:25 +02:00
Sergey Dolin
55bf2e2f65 improve isHosted readability 2023-07-25 15:51:23 +02:00
2 changed files with 9 additions and 7 deletions

6
dist/setup/index.js vendored
View File

@ -61447,9 +61447,9 @@ function cacheWindowsDir(extPath, tool, version, arch) {
return __awaiter(this, void 0, void 0, function* () {
if (os_1.default.platform() !== 'win32')
return false;
const isHosted = process.env['RUNNER_ENVIRONMENT'] === 'github-hosted' ||
process.env['AGENT_ISSELFHOSTED'] === '0';
if (!isHosted)
// make sure the action runs in the hosted environment
if (process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' &&
process.env['AGENT_ISSELFHOSTED'] === '1')
return false;
const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE'];
if (!defaultToolCacheRoot)

View File

@ -174,10 +174,12 @@ async function cacheWindowsDir(
): Promise<string | false> {
if (os.platform() !== 'win32') return false;
const isHosted =
process.env['RUNNER_ENVIRONMENT'] === 'github-hosted' ||
process.env['AGENT_ISSELFHOSTED'] === '0';
if (!isHosted) return false;
// make sure the action runs in the hosted environment
if (
process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' &&
process.env['AGENT_ISSELFHOSTED'] === '1'
)
return false;
const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE'];
if (!defaultToolCacheRoot) return false;