mirror of
https://github.com/actions/setup-node.git
synced 2026-06-14 14:13:52 +08:00
Compare commits
3 Commits
dependabot
...
9b950d3bc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b950d3bc3 | ||
|
|
d02c89dce7 | ||
|
|
844d397646 |
@@ -12,4 +12,5 @@ allowed:
|
||||
- unlicense
|
||||
|
||||
reviewed:
|
||||
npm:
|
||||
npm:
|
||||
- "@actions/http-client"
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
name: "@actions/http-client"
|
||||
version: 3.0.0
|
||||
version: 3.0.2
|
||||
type: npm
|
||||
summary: Actions Http Client
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
||||
license: mit
|
||||
license: other
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
2
.licenses/npm/fast-xml-parser.dep.yml
generated
2
.licenses/npm/fast-xml-parser.dep.yml
generated
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: fast-xml-parser
|
||||
version: 5.3.3
|
||||
version: 5.3.4
|
||||
type: npm
|
||||
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
|
||||
homepage:
|
||||
|
||||
34
.licenses/npm/undici-6.23.0.dep.yml
generated
Normal file
34
.licenses/npm/undici-6.23.0.dep.yml
generated
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: undici
|
||||
version: 6.23.0
|
||||
type: npm
|
||||
summary: An HTTP/1.1 client, written from scratch for Node.js
|
||||
homepage: https://undici.nodejs.org
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
MIT License
|
||||
|
||||
Copyright (c) Matteo Collina and Undici contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
- sources: README.md
|
||||
text: MIT
|
||||
notices: []
|
||||
27561
dist/cache-save/index.js
vendored
27561
dist/cache-save/index.js
vendored
File diff suppressed because one or more lines are too long
27561
dist/setup/index.js
vendored
27561
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
993
package-lock.json
generated
993
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -43,12 +43,12 @@
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^24.1.0",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
||||
"@typescript-eslint/parser": "^8.54.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
||||
"@typescript-eslint/parser": "^5.54.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-jest": "^28.14.0",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
|
||||
@@ -40,11 +40,32 @@ export const supportedPackageManagers: SupportedPackageManagers = {
|
||||
name: 'yarn',
|
||||
lockFilePatterns: ['yarn.lock'],
|
||||
getCacheFolderPath: async projectDir => {
|
||||
const yarnVersion = await getCommandOutputNotEmpty(
|
||||
`yarn --version`,
|
||||
'Could not retrieve version of yarn',
|
||||
projectDir
|
||||
);
|
||||
// Try to enable corepack first if available
|
||||
// This helps with yarn v2+ which requires corepack
|
||||
await enableCorepackIfSupported();
|
||||
|
||||
let yarnVersion: string;
|
||||
try {
|
||||
yarnVersion = await getCommandOutputNotEmpty(
|
||||
`yarn --version`,
|
||||
'Could not retrieve version of yarn',
|
||||
projectDir
|
||||
);
|
||||
} catch (err) {
|
||||
// Check if this is a corepack error message
|
||||
const errorMsg = (err as Error).message;
|
||||
if (
|
||||
errorMsg.includes('packageManager') &&
|
||||
errorMsg.includes('Corepack')
|
||||
) {
|
||||
throw new Error(
|
||||
`Yarn v4+ requires corepack to be enabled. Please run 'corepack enable' before using ` +
|
||||
`actions/setup-node with yarn, or disable caching with 'package-manager-cache: false'. ` +
|
||||
`See: https://github.com/actions/setup-node/issues/1027 for more information.`
|
||||
);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
core.debug(
|
||||
`Consumed yarn version is ${yarnVersion} (working dir: "${
|
||||
@@ -66,6 +87,24 @@ export const supportedPackageManagers: SupportedPackageManagers = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Tries to enable corepack for Node.js versions that support it (16.9+)
|
||||
* This helps with yarn v2+ which requires corepack
|
||||
* See: https://github.com/actions/setup-node/issues/1027
|
||||
*/
|
||||
const enableCorepackIfSupported = async (): Promise<void> => {
|
||||
try {
|
||||
await exec.exec('corepack', ['enable'], {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
});
|
||||
core.debug('Corepack enabled successfully');
|
||||
} catch {
|
||||
// Corepack not available or failed silently
|
||||
core.debug('Corepack not available on this system');
|
||||
}
|
||||
};
|
||||
|
||||
export const getCommandOutput = async (
|
||||
toolCommand: string,
|
||||
cwd?: string
|
||||
|
||||
Reference in New Issue
Block a user