Skip to content

Commit

Permalink
work on resolving comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-shibanov committed Jun 25, 2021
1 parent f2b87bb commit d36a331
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: e2e-cache
on:
pull_request:
paths-ignore:
- '**.md'
push:
- '**.md'
push:
branches:
- main
- releases/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '**.md'
push:
branches:
- main
- main
- releases/*
paths-ignore:
- '**.md'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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>
</p>

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
Expand Down
2 changes: 1 addition & 1 deletion __tests__/cache-restore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/cache-restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/cache-save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d36a331

Please sign in to comment.