mirror of
https://github.com/actions/setup-go.git
synced 2025-06-30 05:03:43 +00:00
Change code according to review points
This commit is contained in:
parent
86d1cd689b
commit
8d80cd6b60
5 changed files with 18 additions and 16 deletions
|
@ -21,14 +21,13 @@ export async function run() {
|
|||
}
|
||||
|
||||
const cachePackages = async () => {
|
||||
|
||||
const cacheInput = core.getInput('cache');
|
||||
if (!cacheInput) {
|
||||
const cache = core.getInput('cache');
|
||||
if (!cache) {
|
||||
return;
|
||||
}
|
||||
|
||||
const packageManager = cacheInput.toUpperCase() === 'TRUE' ? 'default' : cacheInput;
|
||||
|
||||
const packageManager = cache.toUpperCase() === 'TRUE' ? 'default' : cache;
|
||||
|
||||
const state = core.getState(State.CacheMatchedKey);
|
||||
const primaryKey = core.getState(State.CachePrimaryKey);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ export const getPackageManagerInfo = async (packageManager: string) => {
|
|||
`It's not possible to use ${packageManager}, please, check correctness of the package manager name spelling.`
|
||||
);
|
||||
}
|
||||
const obtainedPackageManager = supportedPackageManagers[packageManager]
|
||||
const obtainedPackageManager = supportedPackageManagers[packageManager];
|
||||
|
||||
return obtainedPackageManager;
|
||||
};
|
||||
|
|
|
@ -19,9 +19,8 @@ export async function run() {
|
|||
// since getting unstable versions should be explicit
|
||||
let stable = (core.getInput('stable') || 'true').toUpperCase() === 'TRUE';
|
||||
|
||||
const cacheInput = core.getInput('cache');
|
||||
const cache = cacheInput.toUpperCase() === 'TRUE' ? 'default' : cacheInput;
|
||||
|
||||
const cache = core.getInput('cache');
|
||||
|
||||
core.info(`Setup go ${stable ? 'stable' : ''} version spec ${versionSpec}`);
|
||||
|
||||
if (versionSpec) {
|
||||
|
@ -49,7 +48,7 @@ export async function run() {
|
|||
if (isGhes()) {
|
||||
throw new Error('Caching is not supported on GHES');
|
||||
}
|
||||
const packageManager = core.getInput('package-manager');
|
||||
const packageManager = cache.toUpperCase() === 'TRUE' ? 'default' : cache;
|
||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||
await restoreCache(packageManager, cacheDependencyPath);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue