Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic corepack support for node v14 + #482

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 8 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -31,7 +31,7 @@
"@actions/http-client": "^1.0.11",
"@actions/io": "^1.0.2",
"@actions/tool-cache": "^1.5.4",
"semver": "^6.1.1"
"semver": "^6.3.0"
},
"devDependencies": {
"@types/jest": "^27.0.2",
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Expand Up @@ -4,8 +4,9 @@ import fs from 'fs';
import * as auth from './authutil';
import * as path from 'path';
import {restoreCache} from './cache-restore';
import {isGhes, isCacheFeatureAvailable} from './cache-utils';
import {isGhes, isCacheFeatureAvailable, getCommandOutput} from './cache-utils';
import os = require('os');
import semver from 'semver';

export async function run() {
try {
Expand Down Expand Up @@ -46,6 +47,9 @@ export async function run() {
}

if (cache && isCacheFeatureAvailable()) {
if (semver.gte(version, '14')) {
Ethan-Arrowood marked this conversation as resolved.
Show resolved Hide resolved
await getCommandOutput('corepack enable');
Ethan-Arrowood marked this conversation as resolved.
Show resolved Hide resolved
}
const cacheDependencyPath = core.getInput('cache-dependency-path');
await restoreCache(cache, cacheDependencyPath);
}
Expand Down