mirror of
https://github.com/actions/setup-node.git
synced 2026-03-10 07:01:46 +08:00
Compare commits
4 Commits
87009fc393
...
f1fec09d07
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1fec09d07 | ||
|
|
13427813f7 | ||
|
|
2504c6551f | ||
|
|
a7ea957cac |
@ -22,7 +22,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
uses: actions/publish-action@v0.3.0
|
uses: actions/publish-action@v0.4.0
|
||||||
with:
|
with:
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|||||||
13
src/main.ts
13
src/main.ts
@ -67,12 +67,17 @@ export async function run() {
|
|||||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolvedPackageManager = getNameFromPackageManagerField();
|
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
if (cache && isCacheFeatureAvailable()) {
|
if (isCacheFeatureAvailable()) {
|
||||||
|
// we only determine the package manager type if we can cache in the first place
|
||||||
|
if (cache) {
|
||||||
|
// in previous version of setup-node, user can explicitly specify what package manager they are using, we prefer that
|
||||||
core.saveState(State.CachePackageManager, cache);
|
core.saveState(State.CachePackageManager, cache);
|
||||||
await restoreCache(cache, cacheDependencyPath);
|
await restoreCache(cache, cacheDependencyPath);
|
||||||
} else if (resolvedPackageManager && packagemanagercache) {
|
} else if (packagemanagercache) {
|
||||||
|
// only if user hasn't specify the "cache" (introduced in the previous version) we read the "package-manager-cache" field
|
||||||
|
const resolvedPackageManager = getNameFromPackageManagerField(); // only then we look for "package.json" for package manager
|
||||||
|
if (resolvedPackageManager) {
|
||||||
core.info(
|
core.info(
|
||||||
"Detected package manager from package.json's packageManager field: " +
|
"Detected package manager from package.json's packageManager field: " +
|
||||||
resolvedPackageManager +
|
resolvedPackageManager +
|
||||||
@ -81,6 +86,8 @@ export async function run() {
|
|||||||
core.saveState(State.CachePackageManager, resolvedPackageManager);
|
core.saveState(State.CachePackageManager, resolvedPackageManager);
|
||||||
await restoreCache(resolvedPackageManager, cacheDependencyPath);
|
await restoreCache(resolvedPackageManager, cacheDependencyPath);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const matchersPath = path.join(__dirname, '../..', '.github');
|
const matchersPath = path.join(__dirname, '../..', '.github');
|
||||||
core.info(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
core.info(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user