mirror of
https://github.com/actions/setup-go.git
synced 2025-09-08 11:13:38 -06:00
Set default cache
input to false for self-hosted runners
This commit is contained in:
parent
93397bea11
commit
8b0dfa3b5d
6 changed files with 102 additions and 19 deletions
13
src/utils.ts
13
src/utils.ts
|
@ -1,4 +1,17 @@
|
|||
import * as core from '@actions/core';
|
||||
|
||||
export enum StableReleaseAlias {
|
||||
Stable = 'stable',
|
||||
OldStable = 'oldstable'
|
||||
}
|
||||
|
||||
export const isSelfHosted = (): boolean =>
|
||||
process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' &&
|
||||
process.env['AGENT_ISSELFHOSTED'] === '1';
|
||||
|
||||
export const getCacheInput = (): boolean => {
|
||||
// for self-hosted environment turn off cache by default
|
||||
if (isSelfHosted() && core.getInput('cache') === '') return false;
|
||||
|
||||
return core.getBooleanInput('cache');
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue