Compare commits

..

18 Commits

Author SHA1 Message Date
aparnajyothi-y
f4884e4127 Merge e91964252d into 802632921f 2025-03-10 18:19:41 +05:30
Aparna Jyothi
e91964252d Documentation update 2025-03-10 18:19:35 +05:30
Aparna Jyothi
f338189333 improvements 2025-03-04 16:31:53 +05:30
Aparna Jyothi
8b9906e7bf update 2025-03-04 13:07:51 +05:30
Aparna Jyothi
8495358ea6 added check-latest 2025-03-04 12:50:08 +05:30
Aparna Jyothi
d8619e6d5a suppress warnings 2025-03-04 12:21:43 +05:30
Aparna Jyothi
87063ef0ad npm run format 2025-02-28 16:16:00 +05:30
Aparna Jyothi
5d5d8e9b58 code improvements 2025-02-28 16:11:26 +05:30
Aparna Jyothi
30c33f0409 version update to fix check failures 2025-02-27 18:39:11 +05:30
Aparna Jyothi
a4f5538cea version update from 20.11.0-nightly202312211a0be537da to 20.11.0-nightly 2025-02-27 18:33:27 +05:30
Aparna Jyothi
dd2fa9d9f8 checks update 2025-02-27 18:20:13 +05:30
Aparna Jyothi
d61dc50c40 test case update 2025-02-26 19:00:38 +05:30
Aparna Jyothi
b903bc8693 test cases update 2025-02-26 18:53:51 +05:30
Aparna Jyothi
092c6400ca check failures fix 2025-02-24 13:08:15 +05:30
Aparna Jyothi
7a5031f96f updated test cases 2025-02-24 12:40:37 +05:30
Aparna Jyothi
e5561a4d32 npm run test update 2025-02-21 13:16:46 +05:30
Aparna Jyothi
07b84a2324 check failures fix 2025-02-19 19:28:51 +05:30
Aparna Jyothi
1b0ef2d227 mirror-url -implementation 2025-02-19 19:10:42 +05:30
76 changed files with 6641 additions and 10752 deletions

View File

@@ -4,7 +4,7 @@
"owner": "eslint-compact", "owner": "eslint-compact",
"pattern": [ "pattern": [
{ {
"regexp": "^(.+):\\sline\\s(\\d+),\\scol\\s(\\d+),\\s([Ee]rror|[Ww]arning|[Ii]nfo)\\s-\\s(.+)\\s\\((.+)\\)$", "regexp": "^(.+):\\sline\\s(\\d+),\\scol\\s(\\d+),\\s(Error|Warning|Info)\\s-\\s(.+)\\s\\((.+)\\)$",
"file": 1, "file": 1,
"line": 2, "line": 2,
"column": 3, "column": 3,

View File

@@ -4,7 +4,7 @@
"owner": "eslint-stylish", "owner": "eslint-stylish",
"pattern": [ "pattern": [
{ {
"regexp": "^\\s*([^\\s].*)$", "regexp": "^([^\\s].*)$",
"file": 1 "file": 1
}, },
{ {

View File

@@ -16,4 +16,4 @@ jobs:
name: Basic validation name: Basic validation
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
with: with:
node-version: '24.x' node-version: '20.x'

View File

@@ -19,9 +19,9 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Clean global cache - name: Clean global cache
run: npm cache clean --force run: npm cache clean --force
- name: Setup Node - name: Setup Node
@@ -42,9 +42,9 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with: with:
@@ -75,13 +75,13 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 24] node-version: [18, 20]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Yarn version - name: Yarn version
run: yarn --version run: yarn --version
- name: Generate yarn file - name: Generate yarn file
run: yarn install --ignore-engines run: yarn install
- name: Remove dependencies - name: Remove dependencies
shell: pwsh shell: pwsh
run: Remove-Item node_modules -Force -Recurse run: Remove-Item node_modules -Force -Recurse
@@ -107,9 +107,9 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Update yarn - name: Update yarn
run: yarn set version 3.6.4 run: yarn set version 3.6.4
- name: Yarn version - name: Yarn version
@@ -139,11 +139,11 @@ jobs:
name: Test yarn subprojects name: Test yarn subprojects
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: prepare sub-projects - name: prepare sub-projects
run: __tests__/prepare-yarn-subprojects.sh yarn1 run: __tests__/prepare-yarn-subprojects.sh yarn1
@@ -166,11 +166,11 @@ jobs:
name: Test yarn subprojects all locally managed name: Test yarn subprojects all locally managed
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: prepare sub-projects - name: prepare sub-projects
run: __tests__/prepare-yarn-subprojects.sh keepcache keepcache run: __tests__/prepare-yarn-subprojects.sh keepcache keepcache
@@ -193,11 +193,11 @@ jobs:
name: Test yarn subprojects some locally managed name: Test yarn subprojects some locally managed
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: prepare sub-projects - name: prepare sub-projects
run: __tests__/prepare-yarn-subprojects.sh global run: __tests__/prepare-yarn-subprojects.sh global
@@ -220,11 +220,11 @@ jobs:
name: Test yarn subprojects managed by git name: Test yarn subprojects managed by git
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: prepare sub-projects - name: prepare sub-projects
run: /bin/bash __tests__/prepare-yarn-subprojects.sh keepcache run: /bin/bash __tests__/prepare-yarn-subprojects.sh keepcache
@@ -243,28 +243,3 @@ jobs:
cache-dependency-path: | cache-dependency-path: |
sub2/*.lock sub2/*.lock
sub3/*.lock sub3/*.lock
node-npm-package-manager-cache:
name: Test enabling cache if package manager field is present (Node ${{ matrix.node-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v5
- name: Create package.json with packageManager field
run: |
echo '{ "name": "test-project", "version": "1.0.0", "packageManager": "npm@8.0.0" }' > package.json
- name: Clean global cache
run: npm cache clean --force
- name: Setup Node with caching enabled
uses: ./
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Verify node and npm
run: __tests__/verify-node.sh "${{ matrix.node-version }}"
shell: bash

View File

@@ -25,7 +25,7 @@ jobs:
env: env:
https_proxy: http://squid-proxy:3128 https_proxy: http://squid-proxy:3128
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Clear tool cache - name: Clear tool cache
run: rm -rf $RUNNER_TOOL_CACHE/* run: rm -rf $RUNNER_TOOL_CACHE/*
- name: Setup node 14 - name: Setup node 14
@@ -41,7 +41,7 @@ jobs:
https_proxy: http://no-such-proxy:3128 https_proxy: http://no-such-proxy:3128
no_proxy: api.github.com,github.com,nodejs.org,registry.npmjs.org,*.s3.amazonaws.com,s3.amazonaws.com no_proxy: api.github.com,github.com,nodejs.org,registry.npmjs.org,*.s3.amazonaws.com,s3.amazonaws.com
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Clear tool cache - name: Clear tool cache
run: rm -rf $RUNNER_TOOL_CACHE/* run: rm -rf $RUNNER_TOOL_CACHE/*
- name: Setup node 11 - name: Setup node 11

View File

@@ -14,7 +14,7 @@ jobs:
steps: steps:
- name: Checking out - name: Checking out
uses: actions/checkout@v5 uses: actions/checkout@v4
- name: Publish - name: Publish
id: publish id: publish
uses: actions/publish-immutable-action@v0.0.4 uses: actions/publish-immutable-action@v0.0.4

View File

@@ -18,9 +18,9 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: ./ uses: ./
with: with:
@@ -37,7 +37,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-13]
node-version: [lts/dubnium, lts/erbium, lts/fermium, lts/*, lts/-1] node-version: [lts/dubnium, lts/erbium, lts/fermium, lts/*, lts/-1]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: ./ uses: ./
with: with:
@@ -64,7 +64,7 @@ jobs:
'20.0.0-v8-canary20221101e50e45c9f8' '20.0.0-v8-canary20221101e50e45c9f8'
] ]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: ./ uses: ./
with: with:
@@ -84,7 +84,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [20-nightly, 21-nightly, 18.0.0-nightly] node-version: [20-nightly, 21-nightly, 18.0.0-nightly]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: ./ uses: ./
with: with:
@@ -104,7 +104,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [20.0.0-rc.1, 18.0.0-rc.2, 19.0.0-rc.0] node-version: [20.0.0-rc.1, 18.0.0-rc.2, 19.0.0-rc.0]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: ./ uses: ./
with: with:
@@ -124,7 +124,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18.20.0, 20.10.0, 22.0.0] node-version: [18.20.0, 20.10.0, 22.0.0]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: ./ uses: ./
with: with:
@@ -139,9 +139,9 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22, 24] node-version: [18, 20, 22]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node and check latest - name: Setup Node and check latest
uses: ./ uses: ./
with: with:
@@ -160,13 +160,13 @@ jobs:
node-version-file: node-version-file:
[.nvmrc, .tool-versions, .tool-versions-node, package.json] [.nvmrc, .tool-versions, .tool-versions-node, package.json]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup node from node version file - name: Setup node from node version file
uses: ./ uses: ./
with: with:
node-version-file: '__tests__/data/${{ matrix.node-version-file }}' node-version-file: '__tests__/data/${{ matrix.node-version-file }}'
- name: Verify node - name: Verify node
run: __tests__/verify-node.sh 24 run: __tests__/verify-node.sh 20
version-file-volta: version-file-volta:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -175,13 +175,13 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup node from node version file - name: Setup node from node version file
uses: ./ uses: ./
with: with:
node-version-file: '__tests__/data/package-volta.json' node-version-file: '__tests__/data/package-volta.json'
- name: Verify node - name: Verify node
run: __tests__/verify-node.sh 24 run: __tests__/verify-node.sh 20
version-file-volta-extends: version-file-volta-extends:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -190,13 +190,13 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup node from node version file - name: Setup node from node version file
uses: ./ uses: ./
with: with:
node-version-file: '__tests__/data/package-volta-extends.json' node-version-file: '__tests__/data/package-volta-extends.json'
- name: Verify node - name: Verify node
run: __tests__/verify-node.sh 24 run: __tests__/verify-node.sh 20
node-dist: node-dist:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -206,7 +206,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [17, 19] node-version: [17, 19]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node from dist - name: Setup Node from dist
uses: ./ uses: ./
with: with:
@@ -222,7 +222,7 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-13]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
# test old versions which didn't have npm and layout different # test old versions which didn't have npm and layout different
- name: Setup node 0.12.18 from dist - name: Setup node 0.12.18 from dist
uses: ./ uses: ./
@@ -235,7 +235,7 @@ jobs:
arch: arch:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup node 20 x86 from dist - name: Setup node 20 x86 from dist
uses: ./ uses: ./
with: with:
@@ -259,7 +259,7 @@ jobs:
echo "LATEST_NODE_VERSION=$latestNodeVersion" >> $GITHUB_OUTPUT echo "LATEST_NODE_VERSION=$latestNodeVersion" >> $GITHUB_OUTPUT
id: version id: version
shell: bash shell: bash
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: ./ uses: ./
with: with:

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/cache" name: "@actions/cache"
version: 4.0.3 version: 4.0.2
type: npm type: npm
summary: Actions cache lib summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache homepage: https://github.com/actions/toolkit/tree/main/packages/cache

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/github" name: "@actions/github"
version: 6.0.1 version: 5.1.1
type: npm type: npm
summary: Actions github lib summary: Actions github lib
homepage: https://github.com/actions/toolkit/tree/main/packages/github homepage: https://github.com/actions/toolkit/tree/main/packages/github

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/tool-cache" name: "@actions/tool-cache"
version: 2.0.2 version: 2.0.1
type: npm type: npm
summary: Actions tool-cache lib summary: Actions tool-cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/auth-token" name: "@octokit/auth-token"
version: 4.0.0 version: 2.5.0
type: npm type: npm
summary: GitHub API token authentication for browsers and Node.js summary: GitHub API token authentication for browsers and Node.js
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/core" name: "@octokit/core"
version: 5.2.1 version: 3.6.0
type: npm type: npm
summary: Extendable client for GitHub's REST & GraphQL APIs summary: Extendable client for GitHub's REST & GraphQL APIs
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/endpoint" name: "@octokit/endpoint"
version: 9.0.6 version: 6.0.12
type: npm type: npm
summary: Turns REST API endpoints into generic request options summary: Turns REST API endpoints into generic request options
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/graphql" name: "@octokit/graphql"
version: 7.1.1 version: 4.8.0
type: npm type: npm
summary: GitHub GraphQL API client for browsers and Node summary: GitHub GraphQL API client for browsers and Node
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,20 +0,0 @@
---
name: "@octokit/openapi-types"
version: 24.2.0
type: npm
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage:
license: mit
licenses:
- sources: LICENSE
text: |-
Copyright 2020 Gregor Martynus
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](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/openapi-types" name: "@octokit/openapi-types"
version: 20.0.0 version: 12.11.0
type: npm type: npm
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/plugin-paginate-rest" name: "@octokit/plugin-paginate-rest"
version: 9.2.2 version: 2.21.3
type: npm type: npm
summary: Octokit plugin to paginate REST API endpoint responses summary: Octokit plugin to paginate REST API endpoint responses
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/plugin-rest-endpoint-methods" name: "@octokit/plugin-rest-endpoint-methods"
version: 10.4.1 version: 5.16.2
type: npm type: npm
summary: Octokit plugin adding one method for all of api.github.com REST API endpoints summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/request-error" name: "@octokit/request-error"
version: 5.1.1 version: 2.1.0
type: npm type: npm
summary: Error class for Octokit request errors summary: Error class for Octokit request errors
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,10 +1,10 @@
--- ---
name: "@octokit/request" name: "@octokit/request"
version: 8.4.1 version: 5.6.3
type: npm type: npm
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
and Node and Node
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,20 +0,0 @@
---
name: "@octokit/types"
version: 13.10.0
type: npm
summary: Shared TypeScript definitions for Octokit projects
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License Copyright (c) 2019 Octokit 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 (including the next paragraph) 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](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
--- ---
name: "@octokit/types" name: "@octokit/types"
version: 12.6.0 version: 6.41.0
type: npm type: npm
summary: Shared TypeScript definitions for Octokit projects summary: Shared TypeScript definitions for Octokit projects
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

View File

@@ -1,6 +1,6 @@
--- ---
name: "@protobuf-ts/plugin-framework" name: "@protobuf-ts/plugin-framework"
version: 2.9.5 version: 2.9.4
type: npm type: npm
summary: framework to create protoc plugins summary: framework to create protoc plugins
homepage: https://github.com/timostamm/protobuf-ts homepage: https://github.com/timostamm/protobuf-ts

View File

@@ -1,6 +1,6 @@
--- ---
name: "@protobuf-ts/plugin" name: "@protobuf-ts/plugin"
version: 2.9.5 version: 2.9.4
type: npm type: npm
summary: The protocol buffer compiler plugin "protobuf-ts" generates TypeScript, gRPC-web, summary: The protocol buffer compiler plugin "protobuf-ts" generates TypeScript, gRPC-web,
Twirp, and more. Twirp, and more.

View File

@@ -1,14 +1,14 @@
--- ---
name: "@protobuf-ts/protoc" name: "@protobuf-ts/protoc"
version: 2.9.5 version: 2.9.4
type: npm type: npm
summary: Installs the protocol buffer compiler "protoc" for you. summary: Installs the protocol buffer compiler "protoc" for you.
homepage: https://github.com/timostamm/protobuf-ts homepage: https://github.com/timostamm/protobuf-ts
license: apache-2.0 license: apache-2.0
licenses: licenses:
- sources: Auto-generated Apache-2.0 license text - sources: LICENSE
text: |2 text: |2
Apache License Apache License
Version 2.0, January 2004 Version 2.0, January 2004
http://www.apache.org/licenses/ http://www.apache.org/licenses/
@@ -44,6 +44,7 @@ licenses:
"Work" shall mean the work of authorship, whether in Source or "Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below). (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object "Derivative Works" shall mean any work, whether in Source or Object
@@ -75,6 +76,7 @@ licenses:
2. Grant of Copyright License. Subject to the terms and conditions of 2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual, this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form. Work and such Derivative Works in Source or Object form.
@@ -105,6 +107,7 @@ licenses:
(b) You must cause any modified files to carry prominent notices (b) You must cause any modified files to carry prominent notices
stating that You changed the files; and stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work, attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of excluding those notices that do not pertain to any part of
@@ -179,29 +182,4 @@ licenses:
defend, and hold each Contributor harmless for any liability defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability. of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
notices: [] notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: "@protobuf-ts/runtime-rpc" name: "@protobuf-ts/runtime-rpc"
version: 2.9.5 version: 2.9.4
type: npm type: npm
summary: Runtime library for RPC clients generated by the protoc plugin "protobuf-ts" summary: Runtime library for RPC clients generated by the protoc plugin "protobuf-ts"
homepage: https://github.com/timostamm/protobuf-ts homepage: https://github.com/timostamm/protobuf-ts

View File

@@ -1,6 +1,6 @@
--- ---
name: "@protobuf-ts/runtime" name: "@protobuf-ts/runtime"
version: 2.9.5 version: 2.9.4
type: npm type: npm
summary: Runtime library for code generated by the protoc plugin "protobuf-ts" summary: Runtime library for code generated by the protoc plugin "protobuf-ts"
homepage: https://github.com/timostamm/protobuf-ts homepage: https://github.com/timostamm/protobuf-ts

View File

@@ -1,6 +1,6 @@
--- ---
name: "@types/node" name: "@types/node"
version: 24.1.0 version: 20.11.25
type: npm type: npm
summary: TypeScript definitions for node summary: TypeScript definitions for node
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node

View File

@@ -1,6 +1,6 @@
--- ---
name: brace-expansion name: brace-expansion
version: 1.1.12 version: 1.1.11
type: npm type: npm
summary: Brace expansion as known from sh/bash summary: Brace expansion as known from sh/bash
homepage: https://github.com/juliangruber/brace-expansion homepage: https://github.com/juliangruber/brace-expansion

View File

@@ -1,32 +0,0 @@
---
name: dunder-proto
version: 1.0.1
type: npm
summary: If available, the `Object.prototype.__proto__` accessor and mutator, call-bound
homepage: https://github.com/es-shims/dunder-proto#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2024 ECMAScript Shims
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: es-define-property
version: 1.0.1
type: npm
summary: "`Object.defineProperty`, but not IE 8's broken one."
homepage: https://github.com/ljharb/es-define-property#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2024 Jordan Harband
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: es-errors
version: 1.3.0
type: npm
summary: A simple cache for a few of the JS Error constructors.
homepage: https://github.com/ljharb/es-errors#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2024 Jordan Harband
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: es-object-atoms
version: 1.1.1
type: npm
summary: 'ES Object-related atoms: Object, ToObject, RequireObjectCoercible'
homepage: https://github.com/ljharb/es-object-atoms#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2024 Jordan Harband
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: es-set-tostringtag
version: 2.1.0
type: npm
summary: A helper to optimistically set Symbol.toStringTag, when possible.
homepage: https://github.com/es-shims/es-set-tostringtag#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2022 ECMAScript Shims
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.
notices: []

View File

@@ -1,10 +1,10 @@
--- ---
name: form-data name: form-data
version: 2.5.5 version: 2.5.1
type: npm type: npm
summary: A library to create readable "multipart/form-data" streams. Can be used to summary: A library to create readable "multipart/form-data" streams. Can be used to
submit forms and file uploads to other web applications. submit forms and file uploads to other web applications.
homepage: homepage: https://github.com/form-data/form-data#readme
license: mit license: mit
licenses: licenses:
- sources: License - sources: License

View File

@@ -1,10 +1,10 @@
--- ---
name: form-data name: form-data
version: 4.0.4 version: 4.0.0
type: npm type: npm
summary: A library to create readable "multipart/form-data" streams. Can be used to summary: A library to create readable "multipart/form-data" streams. Can be used to
submit forms and file uploads to other web applications. submit forms and file uploads to other web applications.
homepage: homepage: https://github.com/form-data/form-data#readme
license: mit license: mit
licenses: licenses:
- sources: License - sources: License
@@ -28,6 +28,6 @@ licenses:
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
- sources: README.md - sources: Readme.md
text: Form-Data is released under the [MIT](License) license. text: Form-Data is released under the [MIT](License) license.
notices: [] notices: []

View File

@@ -1,32 +0,0 @@
---
name: function-bind
version: 1.1.2
type: npm
summary: Implementation of Function.prototype.bind
homepage: https://github.com/Raynos/function-bind
license: mit
licenses:
- sources: LICENSE
text: |+
Copyright (c) 2013 Raynos.
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.
notices: []
...

View File

@@ -1,33 +0,0 @@
---
name: get-intrinsic
version: 1.3.0
type: npm
summary: Get and robustly cache all JS language-level intrinsics at first require
time
homepage: https://github.com/ljharb/get-intrinsic#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2020 Jordan Harband
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: get-proto
version: 1.0.1
type: npm
summary: Robustly get the [[Prototype]] of an object
homepage: https://github.com/ljharb/get-proto#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2025 Jordan Harband
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: gopd
version: 1.2.0
type: npm
summary: "`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation."
homepage: https://github.com/ljharb/gopd#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2022 Jordan Harband
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: has-symbols
version: 1.1.0
type: npm
summary: Determine if the JS environment has Symbol support. Supports spec, or shams.
homepage: https://github.com/ljharb/has-symbols#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2016 Jordan Harband
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.
notices: []

View File

@@ -1,33 +0,0 @@
---
name: has-tostringtag
version: 1.0.2
type: npm
summary: Determine if the JS environment has `Symbol.toStringTag` support. Supports
spec, or shams.
homepage: https://github.com/inspect-js/has-tostringtag#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2021 Inspect JS
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.
notices: []

View File

@@ -1,32 +0,0 @@
---
name: hasown
version: 2.0.2
type: npm
summary: A robust, ES3 compatible, "has own property" predicate.
homepage: https://github.com/inspect-js/hasOwn#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Jordan Harband and 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.
notices: []

View File

@@ -1,16 +1,16 @@
--- ---
name: safe-buffer name: is-plain-object
version: 5.2.1 version: 5.0.0
type: npm type: npm
summary: Safer Node.js Buffer API summary: Returns true if an object was created by the `Object` constructor, or Object.create(null).
homepage: https://github.com/feross/safe-buffer homepage: https://github.com/jonschlinkert/is-plain-object
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE
text: | text: |
The MIT License (MIT) The MIT License (MIT)
Copyright (c) Feross Aboukhadijeh Copyright (c) 2014-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -30,5 +30,11 @@ licenses:
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
- sources: README.md - sources: README.md
text: MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) text: |-
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 28, 2019._
notices: [] notices: []

View File

@@ -1,32 +0,0 @@
---
name: math-intrinsics
version: 1.1.0
type: npm
summary: ES Math-related intrinsics and helpers, robustly cached.
homepage: https://github.com/es-shims/math-intrinsics#readme
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2024 ECMAScript Shims
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.
notices: []

View File

@@ -1,17 +1,15 @@
--- ---
name: undici-types name: undici-types
version: 7.8.0 version: 5.26.5
type: npm type: npm
summary: A stand-alone types package for Undici summary: A stand-alone types package for Undici
homepage: https://undici.nodejs.org homepage: https://undici.nodejs.org
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: Auto-generated MIT license text
text: | text: |
MIT License MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights

View File

@@ -1,6 +1,6 @@
--- ---
name: undici name: undici
version: 5.29.0 version: 5.28.5
type: npm type: npm
summary: An HTTP/1.1 client, written from scratch for Node.js summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org homepage: https://undici.nodejs.org

View File

@@ -1,9 +1,9 @@
--- ---
name: universal-user-agent name: universal-user-agent
version: 6.0.1 version: 6.0.0
type: npm type: npm
summary: Get a user agent string in both browser and node summary: Get a user agent string in both browser and node
homepage: homepage:
license: isc license: isc
licenses: licenses:
- sources: LICENSE.md - sources: LICENSE.md

View File

@@ -1,16 +1,16 @@
--- ---
name: call-bind-apply-helpers name: uuid
version: 1.0.2 version: 3.4.0
type: npm type: npm
summary: Helper functions around Function call/apply/bind, for use in `call-bind` summary: RFC4122 (v1, v4, and v5) UUIDs
homepage: https://github.com/ljharb/call-bind-apply-helpers#readme homepage: https://github.com/uuidjs/uuid#readme
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE.md
text: | text: |
MIT License The MIT License (MIT)
Copyright (c) 2024 Jordan Harband Copyright (c) 2010-2016 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -29,4 +29,11 @@ licenses:
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
notices: [] notices:
- sources: AUTHORS
text: |-
Robert Kieffer <robert@broofa.com>
Christoph Tavan <dev@tavan.de>
AJ ONeal <coolaj86@gmail.com>
Vincent Voyer <vincent@zeroload.net>
Roman Shtylman <shtylman@gmail.com>

View File

@@ -1,9 +1,9 @@
--- ---
name: uuid name: uuid
version: 11.1.0 version: 9.0.1
type: npm type: npm
summary: RFC9562 UUIDs summary: RFC4122 (v1, v4, and v5) UUIDs
homepage: homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE.md - sources: LICENSE.md

View File

@@ -1,3 +1,4 @@
# setup-node # setup-node
[![basic-validation](https://github.com/actions/setup-node/actions/workflows/basic-validation.yml/badge.svg)](https://github.com/actions/setup-node/actions/workflows/basic-validation.yml) [![basic-validation](https://github.com/actions/setup-node/actions/workflows/basic-validation.yml/badge.svg)](https://github.com/actions/setup-node/actions/workflows/basic-validation.yml)
@@ -18,7 +19,7 @@ See [action.yml](action.yml)
<!-- start usage --> <!-- start usage -->
```yaml ```yaml
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
# Version Spec of the version to use in SemVer notation. # Version Spec of the version to use in SemVer notation.
# It also admits such aliases as lts/*, latest, nightly and canary builds # It also admits such aliases as lts/*, latest, nightly and canary builds
@@ -77,20 +78,9 @@ See [action.yml](action.yml)
# Default: '' # Default: ''
always-auth: '' always-auth: ''
# Optional mirror to download binaries from. # Optional mirror to download nodejs binaries from.
# Artifacts need to match the official Node.js
# Example:
# V8 Canaray Build: <mirror_url>/download/v8-canary
# RC Build: <mirror_url>/download/rc
# Official: Build <mirror_url>/dist
# Nightly build: <mirror_url>/download/nightly
# Default: '' # Default: ''
mirror: '' mirror-url: ''
# Optional mirror token.
# The token will be used as a bearer token in the Authorization header
# Default: ''
mirror-token: ''
``` ```
<!-- end usage --> <!-- end usage -->
@@ -98,10 +88,10 @@ See [action.yml](action.yml)
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 22
- run: npm ci - run: npm ci
- run: npm test - run: npm test
``` ```
@@ -118,7 +108,7 @@ The `node-version` input supports the Semantic Versioning Specification, for mor
Examples: Examples:
- Major versions: `18`, `20` - Major versions: `20`, `22`
- More specific versions: `10.15`, `16.15.1` , `18.4.0` - More specific versions: `10.15`, `16.15.1` , `18.4.0`
- NVM LTS syntax: `lts/erbium`, `lts/fermium`, `lts/*`, `lts/-n` - NVM LTS syntax: `lts/erbium`, `lts/fermium`, `lts/*`, `lts/-n`
- Latest release: `*` or `latest`/`current`/`node` - Latest release: `*` or `latest`/`current`/`node`
@@ -135,19 +125,7 @@ It's **always** recommended to commit the lockfile of your package manager for s
## Caching global packages data ## Caching global packages data
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under the hood for caching global packages data but requires less configuration settings. Supported package managers are `npm`, `yarn`, `pnpm` (v6.10+). The `cache` input is optional. The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under the hood for caching global packages data but requires less configuration settings. Supported package managers are `npm`, `yarn`, `pnpm` (v6.10+). The `cache` input is optional, and caching is turned off by default.
Caching is turned on by default when a `packageManager` field is detected in the `package.json` file. The `package-manager-cache` input provides control over this automatic caching behavior. By default, `package-manager-cache` is set to `true`, which enables caching when a valid package manager field is detected in the `package.json` file. To disable this automatic caching, set the `package-manager-cache` input to `false`.
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
package-manager-cache: false
- run: npm ci
```
> If no valid `packageManager` field is detected in the `package.json` file, caching will remain disabled unless explicitly configured.
The action defaults to search for the dependency file (`package-lock.json`, `npm-shrinkwrap.json` or `yarn.lock`) in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases when multiple dependency files are used, or they are located in different subdirectories. The action defaults to search for the dependency file (`package-lock.json`, `npm-shrinkwrap.json` or `yarn.lock`) in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases when multiple dependency files are used, or they are located in different subdirectories.
@@ -159,8 +137,8 @@ See the examples of using cache for `yarn`/`pnpm` and `cache-dependency-path` in
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
cache: 'npm' cache: 'npm'
@@ -172,8 +150,8 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
cache: 'npm' cache: 'npm'
@@ -190,12 +168,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
node: [ 14, 16, 18 ] node: [ 18, 20, 22 ]
name: Node ${{ matrix.node }} sample name: Node ${{ matrix.node }} sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup node - name: Setup node
uses: actions/setup-node@v5 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- run: npm ci - run: npm ci
@@ -209,7 +187,7 @@ jobs:
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action: To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action:
```yaml ```yaml
uses: actions/setup-node@v5 uses: actions/setup-node@v4
with: with:
token: ${{ secrets.GH_DOTCOM_TOKEN }} token: ${{ secrets.GH_DOTCOM_TOKEN }}
node-version: 20 node-version: 20
@@ -230,6 +208,7 @@ If the runner is not able to access github.com, any Nodejs versions requested du
- [Publishing to npmjs and GPR with npm](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-npm) - [Publishing to npmjs and GPR with npm](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-npm)
- [Publishing to npmjs and GPR with yarn](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-yarn) - [Publishing to npmjs and GPR with yarn](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-yarn)
- [Using private packages](docs/advanced-usage.md#use-private-packages) - [Using private packages](docs/advanced-usage.md#use-private-packages)
- [Using mirror-url)](https://github.com/aparnajyothi-y/setup-node/edit/add-mirror-url/docs/advanced-usage.md#node-mirrors-nodejs-version-mirrors)
## Recommended permissions ## Recommended permissions
@@ -251,3 +230,5 @@ Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
## Code of Conduct ## Code of Conduct
:wave: Be nice. See [our code of conduct](CODE_OF_CONDUCT.md) :wave: Be nice. See [our code of conduct](CODE_OF_CONDUCT.md)

View File

@@ -498,70 +498,6 @@ describe('setup-node', () => {
); );
} }
); );
it.each([
[
'20.0.0-v8-canary',
'20.0.0-v8-canary20221103f7e2421e91',
'20.0.0-v8-canary20221030fefe1c0879',
'https://my_mirror.org/download/v8-canary/v20.0.0-v8-canary20221103f7e2421e91/node-v20.0.0-v8-canary20221103f7e2421e91-linux-x64.tar.gz'
],
[
'20-v8-canary',
'20.0.0-v8-canary20221103f7e2421e91',
'20.0.0-v8-canary20221030fefe1c0879',
'https://my_mirror.org/download/v8-canary/v20.0.0-v8-canary20221103f7e2421e91/node-v20.0.0-v8-canary20221103f7e2421e91-linux-x64.tar.gz'
],
[
'19.0.0-v8-canary',
'19.0.0-v8-canary202210187d6960f23f',
'19.0.0-v8-canary202210172ec229fc56',
'https://my_mirror.org/download/v8-canary/v19.0.0-v8-canary202210187d6960f23f/node-v19.0.0-v8-canary202210187d6960f23f-linux-x64.tar.gz'
],
[
'19-v8-canary',
'19.0.0-v8-canary202210187d6960f23f',
'19.0.0-v8-canary202210172ec229fc56',
'https://my_mirror.org/download/v8-canary/v19.0.0-v8-canary202210187d6960f23f/node-v19.0.0-v8-canary202210187d6960f23f-linux-x64.tar.gz'
]
])(
'get %s version from dist if check-latest is true',
async (input, expectedVersion, foundVersion, expectedUrl) => {
const foundToolPath = path.normalize(`/cache/node/${foundVersion}/x64`);
const toolPath = path.normalize(`/cache/node/${expectedVersion}/x64`);
inputs['node-version'] = input;
inputs['check-latest'] = 'true';
os['arch'] = 'x64';
os['platform'] = 'linux';
inputs['mirror'] = 'https://my_mirror.org';
inputs['mirror-token'] = 'faketoken';
findSpy.mockReturnValue(foundToolPath);
findAllVersionsSpy.mockReturnValue([
'20.0.0-v8-canary20221030fefe1c0879',
'19.0.0-v8-canary202210172ec229fc56',
'20.0.0-v8-canary2022102310ff1e5a8d'
]);
dlSpy.mockImplementation(async () => '/some/temp/path');
exSpy.mockImplementation(async () => '/some/other/temp/path');
cacheSpy.mockImplementation(async () => toolPath);
// act
await main.run();
// assert
expect(findAllVersionsSpy).toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith(
`Acquiring ${expectedVersion} - ${os.arch} from ${expectedUrl}`
);
expect(logSpy).toHaveBeenCalledWith('Extracting ...');
expect(logSpy).toHaveBeenCalledWith('Adding to the cache ...');
expect(cnSpy).toHaveBeenCalledWith(
`::add-path::${path.join(toolPath, 'bin')}${osm.EOL}`
);
}
);
}); });
describe('setup-node v8 canary tests', () => { describe('setup-node v8 canary tests', () => {

View File

@@ -1 +1 @@
v24 v20

View File

@@ -1 +1 @@
nodejs 24.0.0 nodejs 20.0.0

View File

@@ -1 +1 @@
node 24.0.0 node 20.0.0

View File

@@ -3,6 +3,6 @@
"node": "^14.0.0" "node": "^14.0.0"
}, },
"volta": { "volta": {
"node": "24.0.0" "node": "20.0.0"
} }
} }

View File

@@ -1,5 +1,5 @@
{ {
"engines": { "engines": {
"node": "^24.0.0" "node": "^20.0.0"
} }
} }

View File

@@ -13,6 +13,7 @@ import each from 'jest-each';
import * as main from '../src/main'; import * as main from '../src/main';
import * as util from '../src/util'; import * as util from '../src/util';
import OfficialBuilds from '../src/distributions/official_builds/official_builds'; import OfficialBuilds from '../src/distributions/official_builds/official_builds';
import {validateMirrorURL} from '../src/util';
describe('main tests', () => { describe('main tests', () => {
let inputs = {} as any; let inputs = {} as any;
@@ -20,7 +21,6 @@ describe('main tests', () => {
let infoSpy: jest.SpyInstance; let infoSpy: jest.SpyInstance;
let warningSpy: jest.SpyInstance; let warningSpy: jest.SpyInstance;
let saveStateSpy: jest.SpyInstance;
let inSpy: jest.SpyInstance; let inSpy: jest.SpyInstance;
let setOutputSpy: jest.SpyInstance; let setOutputSpy: jest.SpyInstance;
let startGroupSpy: jest.SpyInstance; let startGroupSpy: jest.SpyInstance;
@@ -54,8 +54,6 @@ describe('main tests', () => {
setOutputSpy.mockImplementation(() => {}); setOutputSpy.mockImplementation(() => {});
warningSpy = jest.spyOn(core, 'warning'); warningSpy = jest.spyOn(core, 'warning');
warningSpy.mockImplementation(() => {}); warningSpy.mockImplementation(() => {});
saveStateSpy = jest.spyOn(core, 'saveState');
saveStateSpy.mockImplementation(() => {});
startGroupSpy = jest.spyOn(core, 'startGroup'); startGroupSpy = jest.spyOn(core, 'startGroup');
startGroupSpy.mockImplementation(() => {}); startGroupSpy.mockImplementation(() => {});
endGroupSpy = jest.spyOn(core, 'endGroup'); endGroupSpy = jest.spyOn(core, 'endGroup');
@@ -283,65 +281,36 @@ describe('main tests', () => {
); );
}); });
}); });
describe('mirror-url parameter', () => {
beforeEach(() => {
inputs['mirror-url'] = 'https://custom-mirror-url.com';
});
describe('cache feature tests', () => { afterEach(() => {
it('Should enable caching with the resolved package manager from packageManager field in package.json when the cache input is not provided', async () => { delete inputs['mirror-url'];
inputs['package-manager-cache'] = 'true'; });
inputs['cache'] = ''; // No cache input is provided
inSpy.mockImplementation(name => inputs[name]); it('Read mirror-url if mirror-url is provided', async () => {
// Arrange
inputs['mirror-url'] = 'https://custom-mirror-url.com';
const readFileSpy = jest.spyOn(fs, 'readFileSync'); // Act
readFileSpy.mockImplementation(() => await main.run();
JSON.stringify({
packageManager: 'yarn@3.2.0' // Assert
}) expect(inputs['mirror-url']).toBeDefined();
});
it('should throw an error if mirror-url is empty', async () => {
// Arrange
inputs['mirror-url'] = ' ';
const logSpy = jest.spyOn(console, 'log').mockImplementation(() => {}); // Mock the log function
// Act & Assert
expect(() => validateMirrorURL(inputs['mirror-url'])).toThrow(
'Mirror URL is empty. Please provide a valid mirror URL.'
); );
await main.run();
expect(saveStateSpy).toHaveBeenCalledWith(expect.anything(), 'yarn');
});
it('Should not enable caching if the packageManager field is missing in package.json and the cache input is not provided', async () => {
inputs['package-manager-cache'] = 'true';
inputs['cache'] = ''; // No cache input is provided
inSpy.mockImplementation(name => inputs[name]);
const readFileSpy = jest.spyOn(fs, 'readFileSync');
readFileSpy.mockImplementation(() =>
JSON.stringify({
//packageManager field is not present
})
);
await main.run();
expect(saveStateSpy).not.toHaveBeenCalled();
});
it('Should skip caching when package-manager-cache is false', async () => {
inputs['package-manager-cache'] = 'false';
inputs['cache'] = ''; // No cache input is provided
inSpy.mockImplementation(name => inputs[name]);
await main.run();
expect(saveStateSpy).not.toHaveBeenCalled();
});
it('Should enable caching with cache input explicitly provided', async () => {
inputs['package-manager-cache'] = 'true';
inputs['cache'] = 'npm'; // Explicit cache input provided
inSpy.mockImplementation(name => inputs[name]);
isCacheActionAvailable.mockReturnValue(true);
await main.run();
expect(saveStateSpy).toHaveBeenCalledWith(expect.anything(), 'npm');
}); });
}); });
}); });

View File

@@ -315,7 +315,7 @@ describe('setup-node', () => {
await main.run(); await main.run();
workingUrls.forEach(url => { workingUrls.forEach(url => {
expect(dlSpy).toHaveBeenCalledWith(url, undefined, undefined); expect(dlSpy).toHaveBeenCalledWith(url);
}); });
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${toolPath}${osm.EOL}`); expect(cnSpy).toHaveBeenCalledWith(`::add-path::${toolPath}${osm.EOL}`);
}); });
@@ -449,54 +449,6 @@ describe('setup-node', () => {
} }
}, 100000); }, 100000);
it('acquires specified architecture of node from mirror', async () => {
for (const {arch, version, osSpec} of [
{
arch: 'x86',
version: '18.0.0-nightly202110204cb3e06ed8',
osSpec: 'win32'
},
{
arch: 'x86',
version: '20.0.0-nightly2022101987cdf7d412',
osSpec: 'win32'
}
]) {
os.platform = osSpec;
os.arch = arch;
const fileExtension = os.platform === 'win32' ? '7z' : 'tar.gz';
const platform = {
linux: 'linux',
darwin: 'darwin',
win32: 'win'
}[os.platform];
inputs['node-version'] = version;
inputs['architecture'] = arch;
inputs['always-auth'] = false;
inputs['token'] = 'faketoken';
inputs['mirror'] = 'https://my-mirror.org';
inputs['mirror-token'] = 'my-mirror-token';
const expectedUrl = `https://my-mirror.org/download/nightly/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
// ... but not in the local cache
findSpy.mockImplementation(() => '');
findAllVersionsSpy.mockImplementation(() => []);
dlSpy.mockImplementation(async () => '/some/temp/path');
const toolPath = path.normalize(`/cache/node/${version}/${arch}`);
exSpy.mockImplementation(async () => '/some/other/temp/path');
cacheSpy.mockImplementation(async () => toolPath);
await main.run();
expect(dlSpy).toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith(
`Acquiring ${version} - ${arch} from ${expectedUrl}`
);
}
}, 100000);
describe('nightly versions', () => { describe('nightly versions', () => {
it.each([ it.each([
[ [

View File

@@ -10,6 +10,8 @@ import osm from 'os';
import path from 'path'; import path from 'path';
import * as main from '../src/main'; import * as main from '../src/main';
import * as auth from '../src/authutil'; import * as auth from '../src/authutil';
import isLtsAlias from '../src/distributions/official_builds/official_builds';
import OfficialBuilds from '../src/distributions/official_builds/official_builds'; import OfficialBuilds from '../src/distributions/official_builds/official_builds';
import {INodeVersion} from '../src/distributions/base-models'; import {INodeVersion} from '../src/distributions/base-models';
@@ -282,43 +284,6 @@ describe('setup-node', () => {
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`); expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`);
}); });
it('falls back to a version from node dist from mirror', async () => {
os.platform = 'linux';
os.arch = 'x64';
// a version which is not in the manifest but is in node dist
const versionSpec = '11.15.0';
const mirror = 'https://my_mirror_url';
inputs['node-version'] = versionSpec;
inputs['always-auth'] = false;
inputs['token'] = 'faketoken';
inputs['mirror'] = mirror;
inputs['mirror-token'] = 'faketoken';
// ... but not in the local cache
findSpy.mockImplementation(() => '');
dlSpy.mockImplementation(async () => '/some/temp/path');
const toolPath = path.normalize('/cache/node/11.15.0/x64');
exSpy.mockImplementation(async () => '/some/other/temp/path');
cacheSpy.mockImplementation(async () => toolPath);
await main.run();
const expPath = path.join(toolPath, 'bin');
expect(getManifestSpy).toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith(
`Attempting to download ${versionSpec}...`
);
expect(logSpy).toHaveBeenCalledWith(
`Not found in manifest. Falling back to download directly from ${mirror}`
);
expect(dlSpy).toHaveBeenCalled();
expect(exSpy).toHaveBeenCalled();
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`);
});
it('falls back to a version from node dist', async () => { it('falls back to a version from node dist', async () => {
os.platform = 'linux'; os.platform = 'linux';
os.arch = 'x64'; os.arch = 'x64';
@@ -865,46 +830,35 @@ describe('setup-node', () => {
} }
); );
}); });
describe('mirror-url parameter', () => {
it('default if mirror url is not provided', async () => {
os.platform = 'linux';
os.arch = 'x64';
it('acquires specified architecture of node from mirror', async () => { inputs['node-version'] = '11';
for (const {arch, version, osSpec} of [ inputs['check-latest'] = 'true';
{arch: 'x86', version: '12.16.2', osSpec: 'win32'},
{arch: 'x86', version: '14.0.0', osSpec: 'win32'}
]) {
os.platform = osSpec;
os.arch = arch;
const fileExtension = os.platform === 'win32' ? '7z' : 'tar.gz';
const platform = {
linux: 'linux',
darwin: 'darwin',
win32: 'win'
}[os.platform];
inputs['node-version'] = version;
inputs['architecture'] = arch;
inputs['always-auth'] = false; inputs['always-auth'] = false;
inputs['token'] = 'faketoken'; inputs['token'] = 'faketoken';
inputs['mirror'] = 'https://my_mirror_url';
inputs['mirror-token'] = 'faketoken';
const expectedUrl =
arch === 'x64'
? `https://github.com/actions/node-versions/releases/download/${version}/node-${version}-${platform}-${arch}.zip`
: `https://my_mirror_url/dist/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
// ... but not in the local cache
findSpy.mockImplementation(() => '');
dlSpy.mockImplementation(async () => '/some/temp/path'); dlSpy.mockImplementation(async () => '/some/temp/path');
const toolPath = path.normalize(`/cache/node/${version}/${arch}`); const toolPath = path.normalize('/cache/node/12.11.0/x64');
exSpy.mockImplementation(async () => '/some/other/temp/path'); exSpy.mockImplementation(async () => '/some/other/temp/path');
cacheSpy.mockImplementation(async () => toolPath); cacheSpy.mockImplementation(async () => toolPath);
const dlmirrorSpy = jest.fn();
dlmirrorSpy.mockImplementation(async () => 'mocked-download-path');
await main.run(); await main.run();
const expPath = path.join(toolPath, 'bin');
expect(dlSpy).toHaveBeenCalled(); expect(dlSpy).toHaveBeenCalled();
expect(exSpy).toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith( expect(logSpy).toHaveBeenCalledWith(
`Acquiring ${version} - ${arch} from ${expectedUrl}` 'Attempt to resolve the latest version from manifest...'
); );
}
}, 100000); expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`);
});
});
}); });

View File

@@ -7,13 +7,8 @@ fi
node_version="$(node --version)" node_version="$(node --version)"
echo "Found node version '$node_version'" echo "Found node version '$node_version'"
if [ -z "$(echo $node_version | grep --fixed-strings v$1)" ]; then
# Extract the major version from the node version (remove the 'v' prefix) echo "Unexpected version"
actual_major_version=$(echo $node_version | sed -E 's/^v([0-9]+)\..*/\1/')
expected_major_version=$(echo $1 | sed -E 's/^([0-9]+)\..*/\1/') # Extract major version from argument
if [ "$actual_major_version" != "$expected_major_version" ]; then
echo "Expected Node.js $expected_major_version.x.x but found $node_version"
exit 1 exit 1
fi fi

View File

@@ -16,6 +16,9 @@ inputs:
default: false default: false
registry-url: registry-url:
description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.' description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.'
mirror-url:
description: 'Custom mirror URL to download Node.js'
required: false
scope: scope:
description: 'Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).' description: 'Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).'
token: token:
@@ -23,15 +26,8 @@ inputs:
default: ${{ github.server_url == 'https://github.com' && github.token || '' }} default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
cache: cache:
description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.' description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.'
package-manager-cache:
description: 'Set to false to disable automatic caching based on the package manager field in package.json. By default, caching is enabled if the package manager field is present.'
default: true
cache-dependency-path: cache-dependency-path:
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.' description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
mirror:
description: 'Used to specify an alternative mirror to downlooad Node.js binaries from'
mirror-token:
description: 'The token used as Authorization header when fetching from the mirror'
# TODO: add input to control forcing to pull from cloud or dist. # 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 # escape valve for someone having issues or needing the absolute latest which isn't cached yet
outputs: outputs:
@@ -40,7 +36,7 @@ outputs:
node-version: node-version:
description: 'The installed node version.' description: 'The installed node version.'
runs: runs:
using: 'node24' using: 'node20'
main: 'dist/setup/index.js' main: 'dist/setup/index.js'
post: 'dist/cache-save/index.js' post: 'dist/cache-save/index.js'
post-if: success() post-if: success()

4366
dist/cache-save/index.js vendored

File diff suppressed because one or more lines are too long

10546
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,5 @@
## Working with lockfiles ## Working with lockfiles
All supported package managers recommend that you **always** commit the lockfile, although implementations vary doing so generally provides the following benefits: All supported package managers recommend that you **always** commit the lockfile, although implementations vary doing so generally provides the following benefits:
@@ -45,8 +47,8 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '16' node-version: '16'
check-latest: true check-latest: true
@@ -63,8 +65,8 @@ See [supported version syntax](https://github.com/actions/setup-node#supported-v
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
- run: npm ci - run: npm ci
@@ -76,10 +78,10 @@ When using the `package.json` input, the action will look for `volta.node` first
```json ```json
{ {
"engines": { "engines": {
"node": ">=16.0.0" "node": ">=18.0.0"
}, },
"volta": { "volta": {
"node": "16.0.0" "node": "22.0.0"
} }
} }
``` ```
@@ -97,10 +99,10 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '22'
architecture: 'x64' # optional, x64 or x86. If not specified, x64 will be used by default architecture: 'x64' # optional, x64 or x86. If not specified, x64 will be used by default
- run: npm ci - run: npm ci
- run: npm test - run: npm test
@@ -118,8 +120,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '20.0.0-v8-canary' # it will install the latest v8 canary release for node 20.0.0 node-version: '20.0.0-v8-canary' # it will install the latest v8 canary release for node 20.0.0
- run: npm ci - run: npm ci
@@ -133,8 +135,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '20-v8-canary' # it will install the latest v8 canary release for node 20 node-version: '20-v8-canary' # it will install the latest v8 canary release for node 20
- run: npm ci - run: npm ci
@@ -149,8 +151,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: 'v20.1.1-v8-canary20221103f7e2421e91' node-version: 'v20.1.1-v8-canary20221103f7e2421e91'
- run: npm ci - run: npm ci
@@ -169,8 +171,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '16-nightly' # it will install the latest nightly release for node 16 node-version: '16-nightly' # it will install the latest nightly release for node 16
- run: npm ci - run: npm ci
@@ -185,8 +187,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '16.0.0-nightly' # it will install the latest nightly release for node 16.0.0 node-version: '16.0.0-nightly' # it will install the latest nightly release for node 16.0.0
- run: npm ci - run: npm ci
@@ -201,8 +203,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '16.0.0-nightly20210420a0261d231c' node-version: '16.0.0-nightly20210420a0261d231c'
- run: npm ci - run: npm ci
@@ -219,8 +221,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Node sample name: Node sample
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '16.0.0-rc.1' node-version: '16.0.0-rc.1'
- run: npm ci - run: npm ci
@@ -236,10 +238,10 @@ The action follows [actions/cache](https://github.com/actions/cache/blob/main/ex
Yarn caching handles both yarn versions: 1 or 2. Yarn caching handles both yarn versions: 1 or 2.
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '22'
cache: 'yarn' cache: 'yarn'
- run: yarn install --frozen-lockfile # optional, --immutable - run: yarn install --frozen-lockfile # optional, --immutable
- run: yarn test - run: yarn test
@@ -255,13 +257,13 @@ steps:
# NOTE: pnpm caching support requires pnpm version >= 6.10.0 # NOTE: pnpm caching support requires pnpm version >= 6.10.0
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
with: with:
version: 6.32.9 version: 6.32.9
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '22'
cache: 'pnpm' cache: 'pnpm'
- run: pnpm install - run: pnpm install
- run: pnpm test - run: pnpm test
@@ -274,10 +276,10 @@ steps:
**Using wildcard patterns to cache dependencies** **Using wildcard patterns to cache dependencies**
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '22'
cache: 'npm' cache: 'npm'
cache-dependency-path: '**/package-lock.json' cache-dependency-path: '**/package-lock.json'
- run: npm ci - run: npm ci
@@ -287,10 +289,10 @@ steps:
**Using a list of file paths to cache dependencies** **Using a list of file paths to cache dependencies**
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '22'
cache: 'npm' cache: 'npm'
cache-dependency-path: | cache-dependency-path: |
server/app/package-lock.json server/app/package-lock.json
@@ -312,9 +314,9 @@ jobs:
- macos-latest - macos-latest
- windows-latest - windows-latest
node_version: node_version:
- 12 - 18
- 14 - 20
- 16 - 22
architecture: architecture:
- x64 - x64
# an extra windows-x86 run: # an extra windows-x86 run:
@@ -324,9 +326,9 @@ jobs:
architecture: x86 architecture: x86
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }} name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Setup node - name: Setup node
uses: actions/setup-node@v5 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node_version }} node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }} architecture: ${{ matrix.architecture }}
@@ -337,16 +339,16 @@ jobs:
## Publish to npmjs and GPR with npm ## Publish to npmjs and GPR with npm
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14.x' node-version: '22'
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
- run: npm ci - run: npm ci
- run: npm publish - run: npm publish
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
registry-url: 'https://npm.pkg.github.com' registry-url: 'https://npm.pkg.github.com'
- run: npm publish - run: npm publish
@@ -357,16 +359,16 @@ steps:
## Publish to npmjs and GPR with yarn ## Publish to npmjs and GPR with yarn
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14.x' node-version: '22'
registry-url: <registry url> registry-url: <registry url>
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
- run: yarn publish - run: yarn publish
env: env:
NODE_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }}
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
registry-url: 'https://npm.pkg.github.com' registry-url: 'https://npm.pkg.github.com'
- run: yarn publish - run: yarn publish
@@ -377,10 +379,10 @@ steps:
## Use private packages ## Use private packages
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14.x' node-version: '22'
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
# Skip post-install scripts here, as a malicious # Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN. # script could steal NODE_AUTH_TOKEN.
@@ -397,8 +399,8 @@ Below you can find a sample "Setup .yarnrc.yml" step, that is going to allow you
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- uses: actions/setup-node@v5 - uses: actions/setup-node@v4
with: with:
node-version: '14.x' node-version: '14.x'
- name: Setup .yarnrc.yml - name: Setup .yarnrc.yml
@@ -419,17 +421,14 @@ Please refer to the [Ensuring workflow access to your package - Configuring a pa
### always-auth input ### always-auth input
The always-auth input sets `always-auth=true` in .npmrc file. With this option set [npm](https://docs.npmjs.com/cli/v6/using-npm/config#always-auth)/yarn sends the authentication credentials when making a request to the registries. The always-auth input sets `always-auth=true` in .npmrc file. With this option set [npm](https://docs.npmjs.com/cli/v6/using-npm/config#always-auth)/yarn sends the authentication credentials when making a request to the registries.
## Use private mirror ### Using mirror-url
You can use the new mirror-url parameter to specify a custom mirror for downloading node.js versions from a different location
It is possible to use a private mirror hosting Node.js binaries. This mirror must be a full mirror of the official Node.js distribution.
The mirror URL can be set using the `mirror` input.
It is possible to specify a token to authenticate with the mirror using the `mirror-token` input.
The token will be passed as a bearer token in the `Authorization` header.
```yaml ```yaml
- uses: actions/setup-node@v5 steps:
with: - uses: actions/checkout@v4
node-version: '14.x' - uses: actions/setup-node@v4
mirror: 'https://nodejs.org/dist' with:
mirror-token: 'your-mirror-token' node-version: '22'
``` mirror-url: 'https://mirror.example.com/node'
```

774
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,9 @@
{ {
"name": "setup-node", "name": "setup-node",
"version": "5.0.0", "version": "4.0.0",
"private": true, "private": true,
"description": "setup node action", "description": "setup node action",
"main": "lib/setup-node.js", "main": "lib/setup-node.js",
"engines": {
"node": ">=24.0.0"
},
"scripts": { "scripts": {
"build": "ncc build -o dist/setup src/setup-node.ts && ncc build -o dist/cache-save src/cache-save.ts", "build": "ncc build -o dist/setup src/setup-node.ts && ncc build -o dist/cache-save src/cache-save.ts",
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"", "format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
@@ -28,24 +25,24 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^4.0.3", "@actions/cache": "^4.0.2",
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/github": "^6.0.1", "@actions/github": "^5.1.1",
"@actions/glob": "^0.5.0", "@actions/glob": "^0.5.0",
"@actions/http-client": "^2.2.1", "@actions/http-client": "^2.2.1",
"@actions/io": "^1.0.2", "@actions/io": "^1.0.2",
"@actions/tool-cache": "^2.0.2", "@actions/tool-cache": "^2.0.1",
"semver": "^7.6.3", "semver": "^7.6.3",
"uuid": "^11.1.0" "uuid": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
"@types/node": "^24.1.0", "@types/node": "^20.11.25",
"@types/semver": "^7.5.8", "@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.0",
"@vercel/ncc": "^0.38.3", "@vercel/ncc": "^0.38.0",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.9.0", "eslint-plugin-jest": "^27.9.0",

View File

@@ -7,7 +7,6 @@ import {getPackageManagerInfo} from './cache-utils';
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in // Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to // @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
// throw an uncaught exception. Instead of failing this action, just warn. // throw an uncaught exception. Instead of failing this action, just warn.
process.on('uncaughtException', e => { process.on('uncaughtException', e => {
const warningPrefix = '[warning]'; const warningPrefix = '[warning]';
core.info(`${warningPrefix}${e.message}`); core.info(`${warningPrefix}${e.message}`);

View File

@@ -24,7 +24,7 @@ export default abstract class BaseDistribution {
}); });
} }
protected abstract getDistributionUrl(mirror: string): string; protected abstract getDistributionUrl(): string;
public async setupNodeJs() { public async setupNodeJs() {
let nodeJsVersions: INodeVersion[] | undefined; let nodeJsVersions: INodeVersion[] | undefined;
@@ -97,22 +97,41 @@ export default abstract class BaseDistribution {
} }
protected async getNodeJsVersions(): Promise<INodeVersion[]> { protected async getNodeJsVersions(): Promise<INodeVersion[]> {
const initialUrl = this.getDistributionUrl(this.nodeInfo.mirror); const initialUrl = this.getDistributionUrl();
const dataUrl = `${initialUrl}/index.json`; const dataUrl = `${initialUrl}/index.json`;
const headers = {}; const response = await this.httpClient.getJson<INodeVersion[]>(dataUrl);
if (this.nodeInfo.mirrorToken) {
headers['Authorization'] = `Bearer ${this.nodeInfo.mirrorToken}`;
}
const response = await this.httpClient.getJson<INodeVersion[]>(
dataUrl,
headers
);
return response.result || []; return response.result || [];
} }
protected async getMirrorUrlVersions(): Promise<INodeVersion[]> {
const initialUrl = this.getDistributionUrl();
const dataUrl = `${initialUrl}/index.json`;
try {
const response = await this.httpClient.getJson<INodeVersion[]>(dataUrl);
return response.result || [];
} catch (err) {
if (
err instanceof Error &&
err.message.includes('getaddrinfo EAI_AGAIN')
) {
core.setFailed(
`Network error: Failed to resolve the server at ${dataUrl}.Please check your DNS settings or verify that the URL is correct.`
);
} else if (err instanceof hc.HttpClientError && err.statusCode === 404) {
core.setFailed(
`404 Error: Unable to find versions at ${dataUrl}.Please verify that the mirror URL is valid.`
);
} else {
core.setFailed(
`Failed to fetch Node.js versions from ${dataUrl}.Please check the URL and try again.}`
);
}
throw err;
}
}
protected getNodejsDistInfo(version: string) { protected getNodejsDistInfo(version: string) {
const osArch: string = this.translateArchToDistUrl(this.nodeInfo.arch); const osArch: string = this.translateArchToDistUrl(this.nodeInfo.arch);
version = semver.clean(version) || ''; version = semver.clean(version) || '';
@@ -126,7 +145,7 @@ export default abstract class BaseDistribution {
? `${fileName}.zip` ? `${fileName}.zip`
: `${fileName}.7z` : `${fileName}.7z`
: `${fileName}.tar.gz`; : `${fileName}.tar.gz`;
const initialUrl = this.getDistributionUrl(this.nodeInfo.mirror); const initialUrl = this.getDistributionUrl();
const url = `${initialUrl}/v${version}/${urlFileName}`; const url = `${initialUrl}/v${version}/${urlFileName}`;
return <INodeVersionInfo>{ return <INodeVersionInfo>{
@@ -137,17 +156,40 @@ export default abstract class BaseDistribution {
}; };
} }
protected getNodejsMirrorURLInfo(version: string) {
const mirrorURL = this.nodeInfo.mirrorURL;
const osArch: string = this.translateArchToDistUrl(this.nodeInfo.arch);
version = semver.clean(version) || '';
const fileName: string =
this.osPlat == 'win32'
? `node-v${version}-win-${osArch}`
: `node-v${version}-${this.osPlat}-${osArch}`;
const urlFileName: string =
this.osPlat == 'win32'
? this.nodeInfo.arch === 'arm64'
? `${fileName}.zip`
: `${fileName}.7z`
: `${fileName}.tar.gz`;
const url = `${mirrorURL}/v${version}/${urlFileName}`;
return <INodeVersionInfo>{
downloadUrl: url,
resolvedVersion: version,
arch: osArch,
fileName: fileName
};
}
protected async downloadNodejs(info: INodeVersionInfo) { protected async downloadNodejs(info: INodeVersionInfo) {
let downloadPath = ''; let downloadPath = '';
core.info( core.info(
`Acquiring ${info.resolvedVersion} - ${info.arch} from ${info.downloadUrl}` `Acquiring ${info.resolvedVersion} - ${info.arch} from ${info.downloadUrl}`
); );
try { try {
downloadPath = await tc.downloadTool( downloadPath = await tc.downloadTool(info.downloadUrl);
info.downloadUrl,
undefined,
this.nodeInfo.mirrorToken
);
} catch (err) { } catch (err) {
if ( if (
err instanceof tc.HTTPError && err instanceof tc.HTTPError &&
@@ -156,9 +198,23 @@ export default abstract class BaseDistribution {
) { ) {
return await this.acquireWindowsNodeFromFallbackLocation( return await this.acquireWindowsNodeFromFallbackLocation(
info.resolvedVersion, info.resolvedVersion,
info.arch info.arch,
info.downloadUrl
); );
} }
// Handle network-related issues (e.g., DNS resolution failures)
if (
err instanceof Error &&
err.message.includes('getaddrinfo EAI_AGAIN')
) {
core.error(
`Network error: Failed to resolve the server at ${info.downloadUrl}.
This could be due to a DNS resolution issue. Please verify the URL or check your network connection.`
);
}
core.error(
`Download failed from ${info.downloadUrl}. Please check the URl and try again.`
);
throw err; throw err;
} }
@@ -179,9 +235,11 @@ export default abstract class BaseDistribution {
protected async acquireWindowsNodeFromFallbackLocation( protected async acquireWindowsNodeFromFallbackLocation(
version: string, version: string,
arch: string = os.arch() arch: string = os.arch(),
downloadUrl: string
): Promise<string> { ): Promise<string> {
const initialUrl = this.getDistributionUrl(this.nodeInfo.mirror); const initialUrl = this.getDistributionUrl();
core.info('url: ' + initialUrl);
const osArch: string = this.translateArchToDistUrl(arch); const osArch: string = this.translateArchToDistUrl(arch);
// Create temporary folder to download to // Create temporary folder to download to
@@ -198,34 +256,24 @@ export default abstract class BaseDistribution {
core.info(`Downloading only node binary from ${exeUrl}`); core.info(`Downloading only node binary from ${exeUrl}`);
const exePath = await tc.downloadTool( if (downloadUrl != exeUrl) {
exeUrl, core.error(
undefined, 'unable to download node binary with the provided URL. Please check and try again'
this.nodeInfo.mirrorToken );
); }
const exePath = await tc.downloadTool(exeUrl);
await io.cp(exePath, path.join(tempDir, 'node.exe')); await io.cp(exePath, path.join(tempDir, 'node.exe'));
const libPath = await tc.downloadTool( const libPath = await tc.downloadTool(libUrl);
libUrl,
undefined,
this.nodeInfo.mirrorToken
);
await io.cp(libPath, path.join(tempDir, 'node.lib')); await io.cp(libPath, path.join(tempDir, 'node.lib'));
} catch (err) { } catch (err) {
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
exeUrl = `${initialUrl}/v${version}/node.exe`; exeUrl = `${initialUrl}/v${version}/node.exe`;
libUrl = `${initialUrl}/v${version}/node.lib`; libUrl = `${initialUrl}/v${version}/node.lib`;
const exePath = await tc.downloadTool( const exePath = await tc.downloadTool(exeUrl);
exeUrl,
undefined,
this.nodeInfo.mirrorToken
);
await io.cp(exePath, path.join(tempDir, 'node.exe')); await io.cp(exePath, path.join(tempDir, 'node.exe'));
const libPath = await tc.downloadTool( const libPath = await tc.downloadTool(libUrl);
libUrl,
undefined,
this.nodeInfo.mirrorToken
);
await io.cp(libPath, path.join(tempDir, 'node.lib')); await io.cp(libPath, path.join(tempDir, 'node.lib'));
} else { } else {
throw err; throw err;

View File

@@ -4,8 +4,7 @@ export interface NodeInputs {
auth?: string; auth?: string;
checkLatest: boolean; checkLatest: boolean;
stable: boolean; stable: boolean;
mirror: string; mirrorURL?: string;
mirrorToken: string;
} }
export interface INodeVersionInfo { export interface INodeVersionInfo {

View File

@@ -3,12 +3,16 @@ import {NodeInputs} from '../base-models';
export default class NightlyNodejs extends BasePrereleaseNodejs { export default class NightlyNodejs extends BasePrereleaseNodejs {
protected distribution = 'nightly'; protected distribution = 'nightly';
constructor(nodeInfo: NodeInputs) { constructor(nodeInfo: NodeInputs) {
super(nodeInfo); super(nodeInfo);
} }
protected getDistributionUrl(mirror: string): string { protected getDistributionUrl(): string {
const url = mirror || 'https://nodejs.org'; if (this.nodeInfo.mirrorURL) {
return `${url}/download/nightly`; return this.nodeInfo.mirrorURL;
} else {
return 'https://nodejs.org/download/nightly';
}
} }
} }

View File

@@ -15,117 +15,125 @@ export default class OfficialBuilds extends BaseDistribution {
} }
public async setupNodeJs() { public async setupNodeJs() {
let manifest: tc.IToolRelease[] | undefined; if (this.nodeInfo.mirrorURL) {
let nodeJsVersions: INodeVersion[] | undefined; try {
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch); core.info(`Attempting to download using mirror URL...`);
await this.downloadFromMirrorURL(); // Attempt to download from the mirror
} catch (err) {
core.setFailed((err as Error).message);
}
} else {
core.info('Setup Node.js');
let manifest: tc.IToolRelease[] | undefined;
let nodeJsVersions: INodeVersion[] | undefined;
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
if (this.isLtsAlias(this.nodeInfo.versionSpec)) { if (this.isLtsAlias(this.nodeInfo.versionSpec)) {
core.info('Attempt to resolve LTS alias from manifest...'); core.info('Attempt to resolve LTS alias from manifest...');
// No try-catch since it's not possible to resolve LTS alias without manifest // No try-catch since it's not possible to resolve LTS alias without manifest
manifest = await this.getManifest(); manifest = await this.getManifest();
this.nodeInfo.versionSpec = this.resolveLtsAliasFromManifest( this.nodeInfo.versionSpec = this.resolveLtsAliasFromManifest(
this.nodeInfo.versionSpec, this.nodeInfo.versionSpec,
this.nodeInfo.stable, this.nodeInfo.stable,
manifest manifest
);
}
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
nodeJsVersions = await this.getNodeJsVersions();
const versions = this.filterVersions(nodeJsVersions);
this.nodeInfo.versionSpec = this.evaluateVersions(versions);
core.info('getting latest node version...');
}
if (this.nodeInfo.checkLatest) {
core.info('Attempt to resolve the latest version from manifest...');
const resolvedVersion = await this.resolveVersionFromManifest(
this.nodeInfo.versionSpec,
this.nodeInfo.stable,
osArch,
manifest
);
if (resolvedVersion) {
this.nodeInfo.versionSpec = resolvedVersion;
core.info(`Resolved as '${resolvedVersion}'`);
} else {
core.info(
`Failed to resolve version ${this.nodeInfo.versionSpec} from manifest`
); );
} }
}
let toolPath = this.findVersionInHostedToolCacheDirectory(); if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
nodeJsVersions = await this.getNodeJsVersions();
const versions = this.filterVersions(nodeJsVersions);
this.nodeInfo.versionSpec = this.evaluateVersions(versions);
if (toolPath) { core.info('getting latest node version...');
core.info(`Found in cache @ ${toolPath}`); }
this.addToolPath(toolPath);
return;
}
let downloadPath = ''; if (this.nodeInfo.checkLatest) {
try { core.info('Attempt to resolve the latest version from manifest...');
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`); const resolvedVersion = await this.resolveVersionFromManifest(
this.nodeInfo.versionSpec,
const versionInfo = await this.getInfoFromManifest( this.nodeInfo.stable,
this.nodeInfo.versionSpec, osArch,
this.nodeInfo.stable, manifest
osArch,
manifest
);
if (versionInfo) {
core.info(
`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`
); );
downloadPath = await tc.downloadTool( if (resolvedVersion) {
versionInfo.downloadUrl, this.nodeInfo.versionSpec = resolvedVersion;
undefined, core.info(`Resolved as '${resolvedVersion}'`);
this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth } else {
); core.info(
`Failed to resolve version ${this.nodeInfo.versionSpec} from manifest`
if (downloadPath) {
toolPath = await this.extractArchive(
downloadPath,
versionInfo,
false
); );
} }
} else {
core.info(
`Not found in manifest. Falling back to download directly from ${
this.nodeInfo.mirror || 'Node'
}`
);
} }
} catch (err) {
// Rate limit? let toolPath = this.findVersionInHostedToolCacheDirectory();
if (
err instanceof tc.HTTPError && if (toolPath) {
(err.httpStatusCode === 403 || err.httpStatusCode === 429) core.info(`Found in cache @ ${toolPath}`);
) { this.addToolPath(toolPath);
core.info( return;
`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`
);
} else {
core.info((err as Error).message);
} }
core.debug((err as Error).stack ?? 'empty stack');
core.info('Falling back to download directly from Node');
}
if (!toolPath) { let downloadPath = '';
toolPath = await this.downloadDirectlyFromNode(); try {
} core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
if (this.osPlat != 'win32') { const versionInfo = await this.getInfoFromManifest(
toolPath = path.join(toolPath, 'bin'); this.nodeInfo.versionSpec,
} this.nodeInfo.stable,
osArch,
manifest
);
core.addPath(toolPath); if (versionInfo) {
core.info(
`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`
);
downloadPath = await tc.downloadTool(
versionInfo.downloadUrl,
undefined,
this.nodeInfo.auth
);
if (downloadPath) {
toolPath = await this.extractArchive(
downloadPath,
versionInfo,
false
);
}
} else {
core.info(
'Not found in manifest. Falling back to download directly from Node'
);
}
} catch (err) {
// Rate limit?
if (
err instanceof tc.HTTPError &&
(err.httpStatusCode === 403 || err.httpStatusCode === 429)
) {
core.info(
`Received HTTP status code ${err.httpStatusCode}. This usually indicates the rate limit has been exceeded`
);
} else {
core.info((err as Error).message);
}
core.debug((err as Error).stack ?? 'empty stack');
core.info('Falling back to download directly from Node');
}
if (!toolPath) {
toolPath = await this.downloadDirectlyFromNode();
}
if (this.osPlat != 'win32') {
toolPath = path.join(toolPath, 'bin');
}
core.addPath(toolPath);
}
} }
protected addToolPath(toolPath: string) { protected addToolPath(toolPath: string) {
@@ -178,9 +186,11 @@ export default class OfficialBuilds extends BaseDistribution {
return version; return version;
} }
protected getDistributionUrl(mirror: string): string { protected getDistributionUrl(): string {
const url = mirror || 'https://nodejs.org'; if (this.nodeInfo.mirrorURL) {
return `${url}/dist`; return this.nodeInfo.mirrorURL;
}
return `https://nodejs.org/dist`;
} }
private getManifest(): Promise<tc.IToolRelease[]> { private getManifest(): Promise<tc.IToolRelease[]> {
@@ -188,7 +198,7 @@ export default class OfficialBuilds extends BaseDistribution {
return tc.getManifestFromRepo( return tc.getManifestFromRepo(
'actions', 'actions',
'node-versions', 'node-versions',
this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth, this.nodeInfo.auth,
'main' 'main'
); );
} }
@@ -294,4 +304,39 @@ export default class OfficialBuilds extends BaseDistribution {
private isLatestSyntax(versionSpec): boolean { private isLatestSyntax(versionSpec): boolean {
return ['current', 'latest', 'node'].includes(versionSpec); return ['current', 'latest', 'node'].includes(versionSpec);
} }
protected async downloadFromMirrorURL() {
const nodeJsVersions = await this.getMirrorUrlVersions();
const versions = this.filterVersions(nodeJsVersions);
const evaluatedVersion = this.evaluateVersions(versions);
if (!evaluatedVersion) {
throw new Error(
`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} from the provided mirror-url ${this.nodeInfo.mirrorURL}. Please check the mirror-url`
);
}
const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion);
try {
const toolPath = await this.downloadNodejs(toolName);
return toolPath;
} catch (error) {
if (error instanceof tc.HTTPError && error.httpStatusCode === 404) {
core.setFailed(
`Node version ${this.nodeInfo.versionSpec} for platform ${this.osPlat} and architecture ${this.nodeInfo.arch} was found but failed to download. ` +
'This usually happens when downloadable binaries are not fully updated in the provided mirror-url' +
'To resolve this issue you may either fall back to the older version or try again later.'
);
} else {
core.setFailed(
`An unexpected error occurred like url might not correct`
);
}
throw error;
}
}
} }

View File

@@ -5,9 +5,11 @@ export default class RcBuild extends BaseDistribution {
constructor(nodeInfo: NodeInputs) { constructor(nodeInfo: NodeInputs) {
super(nodeInfo); super(nodeInfo);
} }
protected getDistributionUrl(): string {
getDistributionUrl(mirror: string): string { if (this.nodeInfo.mirrorURL) {
const url = mirror || 'https://nodejs.org'; return this.nodeInfo.mirrorURL;
return `${url}/download/rc`; } else {
return 'https://nodejs.org/download/rc';
}
} }
} }

View File

@@ -1,14 +1,16 @@
import BasePrereleaseNodejs from '../base-distribution-prerelease'; import BasePrereleaseNodejs from '../base-distribution-prerelease';
import {NodeInputs} from '../base-models'; import {NodeInputs} from '../base-models';
export default class CanaryBuild extends BasePrereleaseNodejs { export default class CanaryBuild extends BasePrereleaseNodejs {
protected distribution = 'v8-canary'; protected distribution = 'v8-canary';
constructor(nodeInfo: NodeInputs) { constructor(nodeInfo: NodeInputs) {
super(nodeInfo); super(nodeInfo);
} }
protected getDistributionUrl(mirror: string): string { protected getDistributionUrl(): string {
const url = mirror || 'https://nodejs.org'; if (this.nodeInfo.mirrorURL) {
return `${url}/download/v8-canary`; return this.nodeInfo.mirrorURL;
} else {
return 'https://nodejs.org/download/v8-canary';
}
} }
} }

View File

@@ -1,7 +1,6 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import os from 'os'; import os from 'os';
import fs from 'fs';
import * as auth from './authutil'; import * as auth from './authutil';
import * as path from 'path'; import * as path from 'path';
@@ -21,9 +20,6 @@ export async function run() {
let arch = core.getInput('architecture'); let arch = core.getInput('architecture');
const cache = core.getInput('cache'); const cache = core.getInput('cache');
const packagemanagercache =
(core.getInput('package-manager-cache') || 'true').toUpperCase() ===
'TRUE';
// if architecture supplied but node-version is not // if architecture supplied but node-version is not
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant. // if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
@@ -37,11 +33,11 @@ export async function run() {
arch = os.arch(); arch = os.arch();
} }
const mirrorURL = core.getInput('mirror-url');
if (version) { if (version) {
const token = core.getInput('token'); const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`; const auth = !token ? undefined : `token ${token}`;
const mirror = core.getInput('mirror');
const mirrorToken = core.getInput('mirror-token');
const stable = const stable =
(core.getInput('stable') || 'true').toUpperCase() === 'TRUE'; (core.getInput('stable') || 'true').toUpperCase() === 'TRUE';
const checkLatest = const checkLatest =
@@ -52,8 +48,7 @@ export async function run() {
auth, auth,
stable, stable,
arch, arch,
mirror, mirrorURL
mirrorToken
}; };
const nodeDistribution = getNodejsDistribution(nodejsInfo); const nodeDistribution = getNodejsDistribution(nodejsInfo);
await nodeDistribution.setupNodeJs(); await nodeDistribution.setupNodeJs();
@@ -67,14 +62,10 @@ export async function run() {
auth.configAuthentication(registryUrl, alwaysAuth); auth.configAuthentication(registryUrl, alwaysAuth);
} }
const resolvedPackageManager = getNameFromPackageManagerField();
const cacheDependencyPath = core.getInput('cache-dependency-path');
if (cache && isCacheFeatureAvailable()) { if (cache && isCacheFeatureAvailable()) {
core.saveState(State.CachePackageManager, cache); core.saveState(State.CachePackageManager, cache);
const cacheDependencyPath = core.getInput('cache-dependency-path');
await restoreCache(cache, cacheDependencyPath); await restoreCache(cache, cacheDependencyPath);
} else if (resolvedPackageManager && packagemanagercache) {
core.saveState(State.CachePackageManager, resolvedPackageManager);
await restoreCache(resolvedPackageManager, cacheDependencyPath);
} }
const matchersPath = path.join(__dirname, '../..', '.github'); const matchersPath = path.join(__dirname, '../..', '.github');
@@ -125,27 +116,3 @@ function resolveVersionInput(): string {
return version; return version;
} }
export function getNameFromPackageManagerField(): string | undefined {
// Check packageManager field in package.json
const SUPPORTED_PACKAGE_MANAGERS = ['npm', 'yarn', 'pnpm'];
try {
const packageJson = JSON.parse(
fs.readFileSync(
path.join(process.env.GITHUB_WORKSPACE!, 'package.json'),
'utf-8'
)
);
const pm = packageJson.packageManager;
if (typeof pm === 'string') {
const regex = new RegExp(
`^(?:\\^)?(${SUPPORTED_PACKAGE_MANAGERS.join('|')})@`
);
const match = pm.match(regex);
return match ? match[1] : undefined;
}
return undefined;
} catch (err) {
return undefined;
}
}

View File

@@ -97,7 +97,13 @@ async function getToolVersion(tool: string, options: string[]) {
return ''; return '';
} }
} }
export function validateMirrorURL(mirrorURL) {
if (mirrorURL === ' ' || mirrorURL.trim() === 'undefined') {
throw new Error('Mirror URL is empty. Please provide a valid mirror URL.');
} else {
return mirrorURL;
}
}
export const unique = () => { export const unique = () => {
const encountered = new Set(); const encountered = new Set();
return (value: unknown): boolean => { return (value: unknown): boolean => {