add corepack option

This commit is contained in:
Adam 2022-07-17 21:58:41 +02:00
parent c81d8ad96d
commit 394059ca5f
3 changed files with 201 additions and 193 deletions

View file

@ -1,12 +1,12 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as installer from './installer';
import fs from 'fs';
import * as auth from './authutil';
import os from 'os';
import * as path from 'path';
import * as auth from './authutil';
import {restoreCache} from './cache-restore';
import {isGhes, isCacheFeatureAvailable} from './cache-utils';
import os = require('os');
import * as installer from './installer';
export async function run() {
try {
@ -48,6 +48,11 @@ export async function run() {
auth.configAuthentication(registryUrl, alwaysAuth);
}
const enableCorepack = core.getInput('corepack');
if (enableCorepack === 'true') {
await exec.exec('corepack', ['enable']);
}
if (cache && isCacheFeatureAvailable()) {
const cacheDependencyPath = core.getInput('cache-dependency-path');
await restoreCache(cache, cacheDependencyPath);