Skip to content

Commit d36a331

Browse files
work on resolving comments
1 parent f2b87bb commit d36a331

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

Diff for: .github/workflows/e2e-cache.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: e2e-cache
33
on:
44
pull_request:
55
paths-ignore:
6-
- '**.md'
7-
push:
6+
- '**.md'
7+
push:
88
branches:
99
- main
1010
- releases/*

Diff for: .github/workflows/versions.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- '**.md'
77
push:
88
branches:
9-
- main
9+
- main
1010
- releases/*
1111
paths-ignore:
1212
- '**.md'

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<a href="https://github.com/actions/setup-node/actions?query=workflow%3Abuild-test"><img alt="build-test status" src="https://github.com/actions/setup-node/workflows/build-test/badge.svg"></a> <a href="https://github.com/actions/setup-node/actions?query=workflow%3Aversions"><img alt="versions status" src="https://github.com/actions/setup-node/workflows/versions/badge.svg"></a> <a href="https://github.com/actions/setup-node/actions?query=workflow%3Aproxy"><img alt="proxy status" src="https://github.com/actions/setup-node/workflows/proxy/badge.svg"></a>
55
</p>
66

7-
This action provides the following functionality for GitHub Actions runners:
7+
This action provides the following functionality for GitHub Actions users:
88

99
- Optionally downloading and caching distribution of the requested Node.js version, and adding it to the PATH
1010
- Optionally caching npm/yarn dependencies

Diff for: __tests__/cache-restore.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe('cache-restore', () => {
126126
await restoreCache(packageManager);
127127
expect(hashFilesSpy).toHaveBeenCalled();
128128
expect(infoSpy).toHaveBeenCalledWith(
129-
`Cache restored from key: ${platform}-${packageManager}-${fileHash}`
129+
`Cache restored from key: node-cache-${platform}-${packageManager}-${fileHash}`
130130
);
131131
expect(infoSpy).not.toHaveBeenCalledWith(
132132
`${packageManager} cache is not found`

Diff for: action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
description: Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user.
2121
default: ${{ github.token }}
2222
cache:
23-
description: 'Used to specify package manager for caching in default directory. Supported values: npm, yarn'
23+
description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn'
2424
# TODO: add input to control forcing to pull from cloud or dist.
2525
# escape valve for someone having issues or needing the absolute latest which isn't cached yet
2626
# Deprecated option, do not use. Will not be supported after October 1, 2019

Diff for: dist/cache-save/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50583,8 +50583,8 @@ const constants_1 = __webpack_require__(196);
5058350583
const cache_utils_1 = __webpack_require__(452);
5058450584
function run() {
5058550585
return __awaiter(this, void 0, void 0, function* () {
50586-
const cacheLock = core.getInput('cache');
5058750586
try {
50587+
const cacheLock = core.getInput('cache');
5058850588
yield cachePackages(cacheLock);
5058950589
}
5059050590
catch (error) {

Diff for: dist/setup/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42732,7 +42732,7 @@ exports.restoreCache = (packageManager) => __awaiter(void 0, void 0, void 0, fun
4273242732
const cachePath = yield cache_utils_1.getCacheDirectoryPath(packageManagerInfo, packageManager);
4273342733
const lockFilePath = findLockFile(packageManagerInfo);
4273442734
const fileHash = yield glob.hashFiles(lockFilePath);
42735-
const primaryKey = `${platform}-${packageManager}-${fileHash}`;
42735+
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
4273642736
core.debug(`primary key is ${primaryKey}`);
4273742737
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
4273842738
const cacheKey = yield cache.restoreCache([cachePath], primaryKey);

Diff for: src/cache-restore.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const restoreCache = async (packageManager: string) => {
2525
const lockFilePath = findLockFile(packageManagerInfo);
2626
const fileHash = await glob.hashFiles(lockFilePath);
2727

28-
const primaryKey = `${platform}-${packageManager}-${fileHash}`;
28+
const primaryKey = `node-cache-${platform}-${packageManager}-${fileHash}`;
2929
core.debug(`primary key is ${primaryKey}`);
3030

3131
core.saveState(State.CachePrimaryKey, primaryKey);

Diff for: src/cache-save.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {State} from './constants';
44
import {getCacheDirectoryPath, getPackageManagerInfo} from './cache-utils';
55

66
export async function run() {
7-
const cacheLock = core.getInput('cache');
87
try {
8+
const cacheLock = core.getInput('cache');
99
await cachePackages(cacheLock);
1010
} catch (error) {
1111
core.setFailed(error.message);

0 commit comments

Comments
 (0)