mirror of
https://github.com/actions/setup-node.git
synced 2025-07-23 23:18:25 +02:00
add corepack option
This commit is contained in:
parent
c81d8ad96d
commit
394059ca5f
3 changed files with 201 additions and 193 deletions
11
src/main.ts
11
src/main.ts
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue