diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index 0a801b788..e7003319c 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -3,8 +3,8 @@ name: e2e-cache on: pull_request: paths-ignore: - - '**.md' - push: + - '**.md' + push: branches: - main - releases/* diff --git a/.github/workflows/versions.yml b/.github/workflows/versions.yml index 7d79b9e8f..b459c8aa8 100644 --- a/.github/workflows/versions.yml +++ b/.github/workflows/versions.yml @@ -6,7 +6,7 @@ on: - '**.md' push: branches: - - main + - main - releases/* paths-ignore: - '**.md' diff --git a/README.md b/README.md index 8458eeafd..b31ebdf50 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ build-test status versions status proxy status

-This action provides the following functionality for GitHub Actions runners: +This action provides the following functionality for GitHub Actions users: - Optionally downloading and caching distribution of the requested Node.js version, and adding it to the PATH - Optionally caching npm/yarn dependencies diff --git a/__tests__/cache-restore.test.ts b/__tests__/cache-restore.test.ts index 105991fb6..18962e577 100644 --- a/__tests__/cache-restore.test.ts +++ b/__tests__/cache-restore.test.ts @@ -126,7 +126,7 @@ describe('cache-restore', () => { await restoreCache(packageManager); expect(hashFilesSpy).toHaveBeenCalled(); expect(infoSpy).toHaveBeenCalledWith( - `Cache restored from key: ${platform}-${packageManager}-${fileHash}` + `Cache restored from key: node-cache-${platform}-${packageManager}-${fileHash}` ); expect(infoSpy).not.toHaveBeenCalledWith( `${packageManager} cache is not found` diff --git a/action.yml b/action.yml index 7be39f1e3..213dc9d24 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: description: Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. default: ${{ github.token }} cache: - description: 'Used to specify package manager for caching in default directory. Supported values: npm, yarn' + description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn' # TODO: add input to control forcing to pull from cloud or dist. # escape valve for someone having issues or needing the absolute latest which isn't cached yet # Deprecated option, do not use. Will not be supported after October 1, 2019 diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 862634662..d4ce3f4ec 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -50583,8 +50583,8 @@ const constants_1 = __webpack_require__(196); const cache_utils_1 = __webpack_require__(452); function run() { return __awaiter(this, void 0, void 0, function* () { - const cacheLock = core.getInput('cache'); try { + const cacheLock = core.getInput('cache'); yield cachePackages(cacheLock); } catch (error) { diff --git a/dist/setup/index.js b/dist/setup/index.js index 77cda7059..af8a5adfe 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -42732,7 +42732,7 @@ exports.restoreCache = (packageManager) => __awaiter(void 0, void 0, void 0, fun const cachePath = yield cache_utils_1.getCacheDirectoryPath(packageManagerInfo, packageManager); const lockFilePath = findLockFile(packageManagerInfo); const fileHash = yield glob.hashFiles(lockFilePath); - const primaryKey = `${platform}-${packageManager}-${fileHash}`; + const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`; core.debug(`primary key is ${primaryKey}`); core.saveState(constants_1.State.CachePrimaryKey, primaryKey); const cacheKey = yield cache.restoreCache([cachePath], primaryKey); diff --git a/src/cache-restore.ts b/src/cache-restore.ts index 3784a2026..a9100252e 100644 --- a/src/cache-restore.ts +++ b/src/cache-restore.ts @@ -25,7 +25,7 @@ export const restoreCache = async (packageManager: string) => { const lockFilePath = findLockFile(packageManagerInfo); const fileHash = await glob.hashFiles(lockFilePath); - const primaryKey = `${platform}-${packageManager}-${fileHash}`; + const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`; core.debug(`primary key is ${primaryKey}`); core.saveState(State.CachePrimaryKey, primaryKey); diff --git a/src/cache-save.ts b/src/cache-save.ts index 01645fc7e..11f830b8a 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -4,8 +4,8 @@ import {State} from './constants'; import {getCacheDirectoryPath, getPackageManagerInfo} from './cache-utils'; export async function run() { - const cacheLock = core.getInput('cache'); try { + const cacheLock = core.getInput('cache'); await cachePackages(cacheLock); } catch (error) { core.setFailed(error.message);