mirror of
https://github.com/azure/setup-kubectl.git
synced 2026-12-02 19:41:54 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1834ceb9a | |||
| 17b39b2181 | |||
| 2f78f07497 | |||
| 5cbd56a156 | |||
| 055d6cc5ff | |||
| ea19a5a5af | |||
| 70dd817170 | |||
| 91c7e1a013 | |||
| e1ae434a6a | |||
| e122dbb2d1 | |||
| a29a84f479 | |||
| ce38e9c621 |
@@ -59,7 +59,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
@@ -86,6 +86,6 @@ jobs:
|
||||
echo ' make release'
|
||||
exit 1
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
|
||||
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
||||
with:
|
||||
category: '/language:${{matrix.language}}'
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
rm -rf node_modules
|
||||
fi
|
||||
|
||||
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
||||
name: Install Python
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'npm'
|
||||
|
||||
@@ -11,6 +11,30 @@ Acceptable values are latest or any semantic version string like `v1.15.0`. Use
|
||||
id: install
|
||||
```
|
||||
|
||||
Alternatively, read the kubectl version from an
|
||||
[asdf/mise `.tool-versions` file](https://asdf-vm.com/manage/configuration.html):
|
||||
|
||||
```yaml
|
||||
- uses: azure/setup-kubectl@v5
|
||||
with:
|
||||
version-file: '.tool-versions'
|
||||
id: install
|
||||
```
|
||||
|
||||
The kubectl entry may use `major.minor`, `major.minor.patch`, an optional `v`
|
||||
prefix, or `latest`:
|
||||
|
||||
```text
|
||||
kubectl 1.31.2
|
||||
```
|
||||
|
||||
If the file contains several `kubectl` entries, the first one is used. The file
|
||||
must be a regular file (not a symbolic link) of at most 64 KiB.
|
||||
|
||||
When both inputs are set, a specific `version` other than `latest` takes
|
||||
precedence and the action emits a warning. The default `version: latest` allows
|
||||
`version-file` to select the version.
|
||||
|
||||
Refer to the action metadata file for details about all the inputs https://github.com/Azure/setup-kubectl/blob/main/action.yml
|
||||
|
||||
# Contributing
|
||||
|
||||
+4
-1
@@ -3,8 +3,11 @@ description: 'Install a specific version of kubectl binary. Acceptable values ar
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version of kubectl'
|
||||
required: true
|
||||
required: false
|
||||
default: 'latest'
|
||||
version-file:
|
||||
description: 'Path to a .tool-versions (asdf/mise) file to read the kubectl version from. A specific version other than latest takes precedence.'
|
||||
required: false
|
||||
downloadBaseURL:
|
||||
description: 'Base URL to download kubectl from (https only). Use for private mirrors.'
|
||||
required: false
|
||||
|
||||
Generated
+199
-178
@@ -15,12 +15,12 @@
|
||||
"@actions/tool-cache": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^26.4.1",
|
||||
"@types/node": "^26.6.11",
|
||||
"esbuild": "^0.28.2",
|
||||
"husky": "^9.1.7",
|
||||
"prettier": "3.9.6",
|
||||
"prettier": "3.10.1",
|
||||
"typescript": "7.0.2",
|
||||
"vitest": "^5.0.0"
|
||||
"vitest": "^5.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
@@ -514,9 +514,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/resolve-uri": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
|
||||
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz",
|
||||
"integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -542,9 +542,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.148.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.148.0.tgz",
|
||||
"integrity": "sha512-Nm4s/jB+4FpFsPhWGEC4h7rzksesmtnMXomo6rCMcg/b8zLQuOziRgkCS1fxDCXOlJB/6Q8oABOZ/OP6RIPj9A==",
|
||||
"version": "0.160.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.160.0.tgz",
|
||||
"integrity": "sha512-gw4k9syEmnckbOgw2A2FU1TBDdX9hfwV9jEn/uio65pguPzwWiXQS3OIJDMEhv9m06tj9XiEe6RoD0YA+LgreA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
@@ -553,9 +553,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm-eabi": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.7.tgz",
|
||||
"integrity": "sha512-EypzgnYCwyVY4NDHKzGmNJT5b+XaQEBniHxsMdeIQLB/tcCzZnhqrzHpZFbX9iaxx+5RiB8caATBtfvZP7zVxQ==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.3.4.tgz",
|
||||
"integrity": "sha512-xCW8CkL/ualx/SbYqeG9iK87lJCZGDQ0soE+kaORJ0Bd+pHALyE4qK7BStmEAyYWLEzZ3/biSIpA6/7GDFvzIg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -571,9 +571,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm64": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.7.tgz",
|
||||
"integrity": "sha512-l17HE9EweWaqJZhuUuNBN/FzM62xw+DECVnJyvMsxn8vJFAGLy5QfLDoYAcronkAN8VxKZHezDpulHDPx95vFw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-5lifIO+b/prcM9sx/bkPN4w6UEToEfQ3gjhx0+0neuL+dkYskI792CfAq03T51jc8JFcaYXs2hi3l8RjiH/VWQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -589,9 +589,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-arm64": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.7.tgz",
|
||||
"integrity": "sha512-8ED8ELFvHXc6OCETIn4gXObPiaR6bckM/ipXtbzlPVDRMBfEGjCKgO90F9YtfdpDatVx/ZQw7aZ1vUMf/+T3Mw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-RCgxTI4AJQxhVF//BI3ImQOsXTHrF4Eg+f99jBy8WoETA2kSEGFxpnrVmW0leQq/2aBR4R5AC6csmy3rc66e3Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -607,9 +607,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-x64": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.7.tgz",
|
||||
"integrity": "sha512-/WPripjtiAIZ2tWY7ddijORT0Ujg87wxWW/qcoFVCKAWVDPhtY0xr7Dj0M3GyNGz60jGwTElhro/mkF9dT7dDQ==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.3.4.tgz",
|
||||
"integrity": "sha512-zNPJVVPUaDEj+L0lImoK3rFv2b+Z5gNijI6DWu/fcD3/1TfmRXKb9ZyxbSN+2AhlctqjbNzUvCsMa+EBhnEM4Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -625,9 +625,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-freebsd-x64": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.7.tgz",
|
||||
"integrity": "sha512-14DI4NcqpvbICxSnGLx3PmtDaWqRP/KGSGb6C+JLLVPeZRl6dKdHba3pGsqT3vpdTqhEYIPG0MMQ8c0xYqoJxA==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.3.4.tgz",
|
||||
"integrity": "sha512-upP6g7ZIRy5by1RDQ/EphHIdJ5xK0eUD7sUgfZFWJ49s4XdbYsIvIlAPtrFpayR70Hhf9J22lb4Pm8/9FhrZmg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -643,9 +643,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.7.tgz",
|
||||
"integrity": "sha512-bxrWIRvHWQvbJwi+VIie/kDJmQxcNE6xxWwZdqF/ExVAigtHkv54WTLQPb+QsZdnFy18fg7JPfWGL0RH6vwIlQ==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.3.4.tgz",
|
||||
"integrity": "sha512-SAX5C5+poMLCxu8dkPF6h5yst40rkzs+9Y3cbPn2OFSydmHjAEprrGi64zGgnYyPIVZfdGUFqJ2fJbfbnHI+mA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -661,9 +661,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-gnu": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.7.tgz",
|
||||
"integrity": "sha512-toOY2BChBZyuxU7OYX6Tn389di4IzAqPTycVcci0O7FSfBqzRB3RZn+K5Is6ANf4tmgRd/K1yZTsNTXbkXsnLg==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-nwHqdlRZS6GWBef3dG5/pMY6RNTBBUjj7s0Da+m6xsFpe7jx6IC46SLZcCu8f46JOfCovZmwnrz51EzGE+7Fyw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -682,9 +682,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-musl": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.7.tgz",
|
||||
"integrity": "sha512-lAIXTH/aiLRLxsTgQvfhjo4K1ydWIp00+V0voOr9beb/9ZmkUFrSIb03dXNFRgMNvkE6oGsF10ioQ6UsI+vS5Q==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.3.4.tgz",
|
||||
"integrity": "sha512-Gr78X2ur/AgLCkmZgHffk/FerIX8S5zb/eII4bCcvJo0ANzeXhTShahdNbpnY6bpiszIAgIfiuKS9ziziWsamw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -703,9 +703,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.7.tgz",
|
||||
"integrity": "sha512-kdnwS28Pkenp/mZMRwjXXXwxQ7pIsm+bF919LUK93BOyhcLsrVKdP2p9fxpiPNPAbNuch8ypQt0pm2P2LYCAGg==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-o9Wcn8nWrsQasaBRYM4d//FwhlBsTJYWkPVlhlt6FwzpwEoovY4IopRZjk5Fq3+ntRuSDORJjF/nA8sFeF2q6w==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -724,9 +724,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-s390x-gnu": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.7.tgz",
|
||||
"integrity": "sha512-516OdsyLdr5E65paF3yBF55t8mfm9+gmtCsK3xI7XKXIT7EfRlHhxL8K/NR6Hu8BWSgF5+1w74lTL0+nxcc8Qw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-UDWu4jkVcx2kiBKm3Ec//4lVCbeTWj8gmJ9SyLWCdLWtTlyq7fQVeVV/14nXvRtSLErvJ2+yA/Ux5taS31Y17Q==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -745,9 +745,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.7.tgz",
|
||||
"integrity": "sha512-r8/z8n7GFaYRln3xmP1Cxy0HH/HLM0uBUPkEuSVEfKGDA89M0FsZRZJRSwe/tJjRx+fpH/gjorfhB8tmEbSFLA==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-W9mGtTa0w4fWh8RLMNPyaEhhcuqUfO07Q4I1bBc4PDMNg7gQSw0yPQNQ3D0qwbkXwxbyL4YrIzc8n6k1vuFExQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -766,9 +766,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-musl": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.7.tgz",
|
||||
"integrity": "sha512-pAsE8iiDxUg1xBqdhrTfg45AVDVpirjz00sblEYClGNNcMnDb+e8beQgqIAw6LvauX/APvgxUnwrgun/YYGBhw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.3.4.tgz",
|
||||
"integrity": "sha512-8B+ofyQZ7/aCmkqnyMonPr5zKLqMVNczhRGFNtdIuItiwNn8iQWJawMq2E58r7bxD1XEbtRRsULY/eCWwZQ01Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -787,9 +787,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-openharmony-arm64": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.7.tgz",
|
||||
"integrity": "sha512-lTcIYmmnQQA8Or/2DatS6oSqcdLHvendjS+zLu+FwgToynWMRSmQdpM65fTANJgIS4mjbMOo5KT2lnT9SAb96w==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-TlD0FSZaC7o2B4NCe9V5N11ugTnhzTM9ksj4sgRLvrKosDzjEkvlsTX3ehkw4ZlPv8AADimZZTvJGEa16pfXug==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -804,10 +804,28 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-wasm32-wasi": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.3.4.tgz",
|
||||
"integrity": "sha512-jwO8P3o53ygo7b5061B7BeaJ1BGv3BKZ6jroFdw/01qWry7Z+qNBlDvulzbTle5s/A0Fc1FRgsTxrke9DvsSbA==",
|
||||
"cpu": [
|
||||
"wasm32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "0.160.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.13.0 || >=23.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-arm64-msvc": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.7.tgz",
|
||||
"integrity": "sha512-e3Gu3WxbNk/UqQhxqU7YIYO+9ZBvWNz3U+h/qRFosscMFzdRPbXYSaSWgSnklv2fz1TgzBTcti2z35c/7irsHw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.3.4.tgz",
|
||||
"integrity": "sha512-8adGMrNtrdzi2WD1ozhYapER59gD8Q/DV6SCKJlyG2HqULPdeQUBvMa33lTsiEYwIqTZUaIU2MmvPp5f1wbtXA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -823,9 +841,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.7.tgz",
|
||||
"integrity": "sha512-W/jg5qoRSqjsEv0+dZi4e687mcHqmVuU0P4fK6qS/xjetW2Gmc1W8j//z5nAeNcC8Ttm0hV46IjcYeuVwYhuiw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.3.4.tgz",
|
||||
"integrity": "sha512-rIMjtESdXJCIoOiUTroQ1Y1rjVDZkuUVRUxs3APX2vNv175D7TDWvzdELiIhzGq9cUNUFat+co+PTmPHPqSREg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -841,9 +859,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/pluginutils": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",
|
||||
"integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz",
|
||||
"integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
@@ -867,20 +885,20 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
|
||||
"integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.11.tgz",
|
||||
"integrity": "sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "26.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.1.tgz",
|
||||
"integrity": "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA==",
|
||||
"version": "26.6.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.11.tgz",
|
||||
"integrity": "sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~8.3.0"
|
||||
"undici-types": "~8.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript/typescript-aix-ppc64": {
|
||||
@@ -1224,22 +1242,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.0.tgz",
|
||||
"integrity": "sha512-66PGTMIiVJP3t4a5yxU9qPtf7MdTBs8jmToMvy+HVflB3Yy13WJZTtPePdvU+wjRV02SKK5doLbSA6o9pwOmiA==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.2.tgz",
|
||||
"integrity": "sha512-UGc97wUIy0Ji2+9GxzHEJiOhiwkaukgE7VYcUNnjpX3sWnwQ8XogmNXX4WyOukxYgKb8Nh2XFa7KId0ZjpmVhQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "0.3.31",
|
||||
"@vitest/spy": "5.0.0",
|
||||
"@vitest/spy": "5.1.2",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^1.2.3"
|
||||
"magic-string": "^1.4.5"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/vitest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"msw": "^2.4.9",
|
||||
"msw": "^2.4.9 || ^3.0.0",
|
||||
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
@@ -1252,9 +1270,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.0.tgz",
|
||||
"integrity": "sha512-uy+luWBAPw9XfthoHi5AkfHUnuPYEESjl0p/r+meoBnU8bxg5GDQ3Ey8MjcJ6sqahkL4PFyrvfMJJBw7LbU06g==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.2.tgz",
|
||||
"integrity": "sha512-PQl0/3+p9GaY71+MHywN6oyHfLhVDD5kcbm7oNRldA2F0ExMU3S8RQdnpteJ9gFAdK5P6KCgE6LqCpUgy57KzA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -1272,9 +1290,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/chai": {
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
|
||||
"integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",
|
||||
"integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1697,19 +1715,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/magic-string": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.2.3.tgz",
|
||||
"integrity": "sha512-Bpb0W2TbLKOZ7vJnOUnVRGq3WL2p+ISV29M6hYPL1AFCpyKZpdr5ytiXoTSSxRVhg8YW7f65+6gbG8WG6PCa/g==",
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz",
|
||||
"integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/sourcemap-codec": "^1.5.5"
|
||||
"@jridgewell/sourcemap-codec": "^1.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.18",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",
|
||||
"integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==",
|
||||
"version": "3.3.20",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1726,10 +1744,29 @@
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/napi-windows-process-start-time": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/napi-windows-process-start-time/-/napi-windows-process-start-time-0.1.0.tgz",
|
||||
"integrity": "sha512-zHxhzKsIFu3elch3eFw69WEUGc79DFhbc3nD/WEOzWL/pFFLZRW13EHnuO0c+0YjncE5uCaS9ICHxOBXkb6vPw==",
|
||||
"cpu": [
|
||||
"x64",
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/obug": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/obug/-/obug-2.1.4.tgz",
|
||||
"integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz",
|
||||
"integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
"https://github.com/sponsors/sxzz",
|
||||
@@ -1762,9 +1799,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.28",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz",
|
||||
"integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==",
|
||||
"version": "8.5.34",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.34.tgz",
|
||||
"integrity": "sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1783,18 +1820,18 @@
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.18",
|
||||
"nanoid": "^3.3.20",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
"source-map-js": "^1.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.9.6",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz",
|
||||
"integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==",
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.10.1.tgz",
|
||||
"integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -1808,14 +1845,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.7.tgz",
|
||||
"integrity": "sha512-g0EtLvBjTUB7jhyV0S/TCup3v/XSVl45vUIGbOGU4QPiyjTenCe4mKuFvW9fEgYmS2Fo42AUssRmNuMziXdrig==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.3.4.tgz",
|
||||
"integrity": "sha512-p2rq4bfBmF0M6yaR8+A89fbkBQynZI2fxUW4G07eq9kpctAkpo7q5BZ4X4Mo4XZ7HHROu33cX9PeopUFN6u+2Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.148.0",
|
||||
"@oxc-project/types": "=0.160.0",
|
||||
"@rolldown/pluginutils": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -1825,21 +1862,22 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.7",
|
||||
"@rolldown/binding-android-arm64": "1.2.7",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.7",
|
||||
"@rolldown/binding-darwin-x64": "1.2.7",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.7",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.7",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.7",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.7",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.7",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.7",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.7",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.7",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.7",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.7",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.7"
|
||||
"@rolldown/binding-android-arm-eabi": "1.3.4",
|
||||
"@rolldown/binding-android-arm64": "1.3.4",
|
||||
"@rolldown/binding-darwin-arm64": "1.3.4",
|
||||
"@rolldown/binding-darwin-x64": "1.3.4",
|
||||
"@rolldown/binding-freebsd-x64": "1.3.4",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.3.4",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.3.4",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-x64-musl": "1.3.4",
|
||||
"@rolldown/binding-openharmony-arm64": "1.3.4",
|
||||
"@rolldown/binding-wasm32-wasi": "1.3.4",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.3.4",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
@@ -1854,42 +1892,28 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/siginfo": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
|
||||
"integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz",
|
||||
"integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/stackback": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
|
||||
"integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/std-env": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz",
|
||||
"integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz",
|
||||
"integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "6.1.4",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.1.4.tgz",
|
||||
"integrity": "sha512-9APumHG7r4yOk4X4WlkmE71aZcv1gvin1czO3OQ1U9iJcFA5Ja/ygyb0vPOVHTthFozUYs8CLoLUlM8grb2lTQ==",
|
||||
"version": "6.2.5",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.5.tgz",
|
||||
"integrity": "sha512-b/8GRMdnY4cqkfCLyaFpTGIv1qwfi3oT0mWaepwT++6Z/ZrYehNfZZ2JDKVLKGhNoEkS3IIB1ELtCT0XS5DtOA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1897,9 +1921,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tinyexec": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz",
|
||||
"integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz",
|
||||
"integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1968,33 +1992,33 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "6.28.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz",
|
||||
"integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==",
|
||||
"version": "6.29.1",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz",
|
||||
"integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.17"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
|
||||
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
|
||||
"version": "8.9.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
||||
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.2.2",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.2.2.tgz",
|
||||
"integrity": "sha512-cFKLV/PRgAUlIRm5WjMjJ86jrftzpqcgH+Us+DS8mI3CDNiH30Whrz8uHL3+MOLPAgqbMBAqWdAHAphOAM+z/Q==",
|
||||
"version": "8.4.0",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.4.0.tgz",
|
||||
"integrity": "sha512-X2nUJg+9cutlz3hzqyO6p+WTwk9H257DjwAEf9EQYUFrQbDItmetadi9gYmb+l7VDy4r3VXLUnmLTwuPmzejDw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.33.0",
|
||||
"picomatch": "^4.0.5",
|
||||
"postcss": "^8.5.26",
|
||||
"rolldown": "~1.2.4",
|
||||
"picomatch": "^4.0.7",
|
||||
"postcss": "^8.5.33",
|
||||
"rolldown": "~1.3.2",
|
||||
"tinyglobby": "^0.2.17"
|
||||
},
|
||||
"bin": {
|
||||
@@ -2007,11 +2031,12 @@
|
||||
"url": "https://github.com/vitejs/vite?sponsor=1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.3"
|
||||
"fsevents": "~2.3.3",
|
||||
"napi-windows-process-start-time": "^0.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^20.19.0 || >=22.12.0",
|
||||
"@vitejs/devtools": "^0.4.0 || ^0.5.0",
|
||||
"@vitejs/devtools": "^0.7.1 || ^0.8.0",
|
||||
"esbuild": "^0.27.0 || ^0.28.0",
|
||||
"jiti": ">=1.21.0",
|
||||
"less": "^4.0.0",
|
||||
@@ -2063,25 +2088,25 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.0.tgz",
|
||||
"integrity": "sha512-gpsMNoRhMjMktVxPtstOH4/PJuPyovVaMDr4oDilXaGH1EcqM2OE96SoHT2VIQ6fTGtTjqmHDrEu2X9RQiXf8Q==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.2.tgz",
|
||||
"integrity": "sha512-VIa2wXV208WraXUbzH+dQUrGcFpPuaiRA8HlhXS8R6/sy9cynw6OMqGj8fmAlH1hot7huTCtWUE14+FdXU3eLw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/mocker": "5.0.0",
|
||||
"chai": "^6.2.2",
|
||||
"@vitest/mocker": "5.1.2",
|
||||
"chai": "^6.3.0",
|
||||
"es-module-lexer": "^2.3.2",
|
||||
"expect-type": "^1.4.0",
|
||||
"magic-string": "^1.2.3",
|
||||
"obug": "^2.1.4",
|
||||
"magic-string": "^1.4.5",
|
||||
"obug": "^3.0.0",
|
||||
"picomatch": "^4.0.7",
|
||||
"std-env": "^4.2.0",
|
||||
"tinybench": "6.1.4",
|
||||
"tinyexec": "1.3.0",
|
||||
"std-env": "^4.3.0",
|
||||
"tinybench": "^6.2.3",
|
||||
"tinyexec": "^1.3.1",
|
||||
"tinyglobby": "^0.2.17",
|
||||
"why-is-node-running": "^2.3.0"
|
||||
"why-is-node-running": "3.2.1"
|
||||
},
|
||||
"bin": {
|
||||
"vitest": "vitest.mjs"
|
||||
@@ -2096,12 +2121,12 @@
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/node": "^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "5.0.0",
|
||||
"@vitest/browser-preview": "5.0.0",
|
||||
"@vitest/browser-playwright": "5.1.2",
|
||||
"@vitest/browser-preview": "5.1.2",
|
||||
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
|
||||
"@vitest/coverage-istanbul": "5.0.0",
|
||||
"@vitest/coverage-v8": "5.0.0",
|
||||
"@vitest/ui": "5.0.0",
|
||||
"@vitest/coverage-istanbul": "5.1.2",
|
||||
"@vitest/coverage-v8": "5.1.2",
|
||||
"@vitest/ui": "5.1.2",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*",
|
||||
"vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
|
||||
@@ -2146,20 +2171,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/why-is-node-running": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
|
||||
"integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz",
|
||||
"integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"siginfo": "^2.0.0",
|
||||
"stackback": "0.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"why-is-node-running": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=20.11"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -27,11 +27,11 @@
|
||||
"@actions/tool-cache": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^26.4.1",
|
||||
"@types/node": "^26.6.11",
|
||||
"esbuild": "^0.28.2",
|
||||
"husky": "^9.1.7",
|
||||
"prettier": "3.9.6",
|
||||
"prettier": "3.10.1",
|
||||
"typescript": "7.0.2",
|
||||
"vitest": "^5.0.0"
|
||||
"vitest": "^5.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,3 +304,80 @@ export function getExecutableExtension(): string {
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
export function parseToolVersionsFile(filePath: string): string {
|
||||
const maxBytes = 64 * 1024
|
||||
let pathStats: fs.BigIntStats
|
||||
try {
|
||||
pathStats = fs.lstatSync(filePath, {bigint: true})
|
||||
} catch (error) {
|
||||
if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
|
||||
throw new Error(`The version-file '${filePath}' was not found.`)
|
||||
}
|
||||
throw error
|
||||
}
|
||||
if (pathStats.isSymbolicLink() || !pathStats.isFile()) {
|
||||
throw new Error(
|
||||
`The version-file '${filePath}' must be a regular file and not a symbolic link.`
|
||||
)
|
||||
}
|
||||
if (pathStats.size > BigInt(maxBytes)) {
|
||||
throw new Error(
|
||||
`The version-file '${filePath}' exceeds the ${maxBytes}-byte size limit.`
|
||||
)
|
||||
}
|
||||
|
||||
const noFollow = fs.constants.O_NOFOLLOW ?? 0
|
||||
// A FIFO swapped in after lstat must not block open before fstat can reject it.
|
||||
// O_NONBLOCK has no effect on regular files; these flags are POSIX-only.
|
||||
const nonBlock = fs.constants.O_NONBLOCK ?? 0
|
||||
const fd = fs.openSync(filePath, fs.constants.O_RDONLY | noFollow | nonBlock)
|
||||
let content: string
|
||||
try {
|
||||
const fileStats = fs.fstatSync(fd, {bigint: true})
|
||||
if (!fileStats.isFile()) {
|
||||
throw new Error(
|
||||
`The version-file '${filePath}' must be a regular file and not a symbolic link.`
|
||||
)
|
||||
}
|
||||
if (pathStats.dev !== fileStats.dev || pathStats.ino !== fileStats.ino) {
|
||||
throw new Error(
|
||||
`The version-file '${filePath}' changed while it was being opened.`
|
||||
)
|
||||
}
|
||||
|
||||
const buffer = Buffer.alloc(maxBytes + 1)
|
||||
let bytesRead = 0
|
||||
while (bytesRead < buffer.length) {
|
||||
const count = fs.readSync(
|
||||
fd,
|
||||
buffer,
|
||||
bytesRead,
|
||||
buffer.length - bytesRead,
|
||||
null
|
||||
)
|
||||
if (count === 0) break
|
||||
bytesRead += count
|
||||
}
|
||||
if (bytesRead > maxBytes) {
|
||||
throw new Error(
|
||||
`The version-file '${filePath}' exceeds the ${maxBytes}-byte size limit.`
|
||||
)
|
||||
}
|
||||
content = buffer.toString('utf8', 0, bytesRead)
|
||||
} finally {
|
||||
fs.closeSync(fd)
|
||||
}
|
||||
|
||||
for (const line of content.split('\n')) {
|
||||
const trimmed = line.trim()
|
||||
if (trimmed.startsWith('#') || trimmed === '') continue
|
||||
const [tool, version] = trimmed.split(/\s+/)
|
||||
if (tool === 'kubectl' && version) {
|
||||
return version
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`Could not find a kubectl entry in tool-versions file: ${filePath}`
|
||||
)
|
||||
}
|
||||
|
||||
+272
-1
@@ -45,6 +45,7 @@ const {
|
||||
getExecutableExtension,
|
||||
getLatestPatchVersion,
|
||||
isDefaultBaseURL,
|
||||
parseToolVersionsFile,
|
||||
secureDownload,
|
||||
validateBaseURL,
|
||||
validateVersion
|
||||
@@ -56,6 +57,20 @@ function mockInputs(inputs: Record<string, string>) {
|
||||
)
|
||||
}
|
||||
|
||||
function mockVersionFileContent(content: string) {
|
||||
const source = Buffer.from(content)
|
||||
let offset = 0
|
||||
vi.mocked(fs.readSync).mockImplementation(
|
||||
(_fd, buffer, bufferOffset, length) => {
|
||||
const count = Math.min(length, source.length - offset)
|
||||
if (count <= 0) return 0
|
||||
source.copy(buffer as Buffer, bufferOffset, offset, offset + count)
|
||||
offset += count
|
||||
return count
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function fakeHttpResponse(opts: {
|
||||
status: number
|
||||
body?: string
|
||||
@@ -108,6 +123,19 @@ describe('Testing all functions in run file.', () => {
|
||||
vi.mocked(fs.openSync).mockReturnValue(3 as never)
|
||||
vi.mocked(fs.writeSync).mockReturnValue(0 as never)
|
||||
vi.mocked(fs.closeSync).mockImplementation(() => {})
|
||||
vi.mocked(fs.fstatSync).mockReturnValue({
|
||||
dev: 1n,
|
||||
ino: 1n,
|
||||
isFile: () => true
|
||||
} as fs.BigIntStats)
|
||||
vi.mocked(fs.readSync).mockReturnValue(0)
|
||||
vi.mocked(fs.lstatSync).mockReturnValue({
|
||||
dev: 1n,
|
||||
ino: 1n,
|
||||
isSymbolicLink: () => false,
|
||||
isFile: () => true,
|
||||
size: 1024n
|
||||
} as fs.BigIntStats)
|
||||
})
|
||||
|
||||
test('getExecutableExtension() - return .exe when os is Windows', () => {
|
||||
@@ -798,7 +826,7 @@ describe('Testing all functions in run file.', () => {
|
||||
vi.mocked(core.setOutput).mockImplementation()
|
||||
|
||||
await expect(run.run()).resolves.toBeUndefined()
|
||||
expect(core.getInput).toHaveBeenCalledWith('version', {required: true})
|
||||
expect(core.getInput).toHaveBeenCalledWith('version')
|
||||
expect(core.getInput).toHaveBeenCalledWith('downloadBaseURL', {
|
||||
required: false
|
||||
})
|
||||
@@ -957,4 +985,247 @@ describe('Testing all functions in run file.', () => {
|
||||
// And the resolved version must be cached/looked up under v1.27.15.
|
||||
expect(toolCache.find).toHaveBeenCalledWith('kubectl', 'v1.27.15')
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - returns kubectl version', () => {
|
||||
mockVersionFileContent('kubectl 1.27.15\nnode 20.0.0\n')
|
||||
expect(parseToolVersionsFile('.tool-versions')).toBe('1.27.15')
|
||||
expect(fs.openSync).toHaveBeenCalledWith(
|
||||
'.tool-versions',
|
||||
fs.constants.O_RDONLY |
|
||||
(fs.constants.O_NOFOLLOW ?? 0) |
|
||||
(fs.constants.O_NONBLOCK ?? 0)
|
||||
)
|
||||
expect(fs.lstatSync).toHaveBeenCalledWith('.tool-versions', {
|
||||
bigint: true
|
||||
})
|
||||
expect(fs.fstatSync).toHaveBeenCalledWith(3, {bigint: true})
|
||||
expect(fs.closeSync).toHaveBeenCalledWith(3)
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - ignores comments and blank lines', () => {
|
||||
mockVersionFileContent('# comment\n\nkubectl 1.27.15\n')
|
||||
expect(parseToolVersionsFile('.tool-versions')).toBe('1.27.15')
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - uses the first kubectl entry', () => {
|
||||
mockVersionFileContent('kubectl 1.27.15\nkubectl 1.30.0\n')
|
||||
expect(parseToolVersionsFile('.tool-versions')).toBe('1.27.15')
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - reports a missing file clearly', () => {
|
||||
vi.mocked(fs.lstatSync).mockImplementation(() => {
|
||||
throw Object.assign(new Error('ENOENT: no such file or directory'), {
|
||||
code: 'ENOENT'
|
||||
})
|
||||
})
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
"The version-file '.tool-versions' was not found."
|
||||
)
|
||||
expect(fs.openSync).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - throws when kubectl entry is absent', () => {
|
||||
vi.mocked(fs.lstatSync).mockReturnValue({
|
||||
dev: 1n,
|
||||
ino: 1n,
|
||||
isSymbolicLink: () => false,
|
||||
isFile: () => true,
|
||||
size: 34n
|
||||
} as fs.BigIntStats)
|
||||
mockVersionFileContent('node 20.0.0\npython 3.11.0\n')
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
'Could not find a kubectl entry in tool-versions file: .tool-versions'
|
||||
)
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - rejects symbolic links', () => {
|
||||
vi.mocked(fs.lstatSync).mockReturnValue({
|
||||
isSymbolicLink: () => true,
|
||||
isFile: () => true,
|
||||
size: 16
|
||||
} as fs.Stats)
|
||||
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
'must be a regular file and not a symbolic link'
|
||||
)
|
||||
expect(fs.readFileSync).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - rejects non-regular files', () => {
|
||||
vi.mocked(fs.lstatSync).mockReturnValue({
|
||||
isSymbolicLink: () => false,
|
||||
isFile: () => false,
|
||||
size: 0
|
||||
} as fs.Stats)
|
||||
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
'must be a regular file and not a symbolic link'
|
||||
)
|
||||
expect(fs.readFileSync).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - rejects files larger than 64 KiB', () => {
|
||||
vi.mocked(fs.lstatSync).mockReturnValue({
|
||||
isSymbolicLink: () => false,
|
||||
isFile: () => true,
|
||||
size: 64 * 1024 + 1
|
||||
} as fs.Stats)
|
||||
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
'exceeds the 65536-byte size limit'
|
||||
)
|
||||
expect(fs.readFileSync).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - rejects a file replaced between check and open', () => {
|
||||
vi.mocked(fs.lstatSync).mockReturnValue({
|
||||
dev: 1n,
|
||||
ino: 10n,
|
||||
isSymbolicLink: () => false,
|
||||
isFile: () => true,
|
||||
size: 16n
|
||||
} as fs.BigIntStats)
|
||||
vi.mocked(fs.fstatSync).mockReturnValue({
|
||||
dev: 1n,
|
||||
ino: 11n,
|
||||
isFile: () => true
|
||||
} as fs.BigIntStats)
|
||||
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
'changed while it was being opened'
|
||||
)
|
||||
expect(fs.readSync).not.toHaveBeenCalled()
|
||||
expect(fs.closeSync).toHaveBeenCalledWith(3)
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - rejects growth beyond 64 KiB after opening', () => {
|
||||
mockVersionFileContent('x'.repeat(64 * 1024 + 1))
|
||||
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
'exceeds the 65536-byte size limit'
|
||||
)
|
||||
expect(fs.closeSync).toHaveBeenCalledWith(3)
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - accepts exactly 64 KiB', () => {
|
||||
mockVersionFileContent(`kubectl 1.27.15\n${' '.repeat(64 * 1024 - 17)}`)
|
||||
|
||||
expect(parseToolVersionsFile('.tool-versions')).toBe('1.27.15')
|
||||
expect(fs.closeSync).toHaveBeenCalledWith(3)
|
||||
})
|
||||
|
||||
test('parseToolVersionsFile() - closes the descriptor when reading fails', () => {
|
||||
vi.mocked(fs.readSync).mockImplementation(() => {
|
||||
throw new Error('read failed')
|
||||
})
|
||||
|
||||
expect(() => parseToolVersionsFile('.tool-versions')).toThrow(
|
||||
'read failed'
|
||||
)
|
||||
expect(fs.closeSync).toHaveBeenCalledWith(3)
|
||||
})
|
||||
|
||||
test('run() - uses version-file to determine kubectl version', async () => {
|
||||
mockInputs({
|
||||
version: '',
|
||||
'version-file': '.tool-versions'
|
||||
})
|
||||
mockVersionFileContent('kubectl 1.27.15\n')
|
||||
vi.mocked(toolCache.find).mockReturnValue('pathToCachedTool')
|
||||
vi.mocked(os.type).mockReturnValue('Linux')
|
||||
vi.mocked(fs.chmodSync).mockImplementation()
|
||||
|
||||
await expect(run.run()).resolves.toBeUndefined()
|
||||
|
||||
expect(fs.openSync).toHaveBeenCalledWith(
|
||||
'.tool-versions',
|
||||
fs.constants.O_RDONLY |
|
||||
(fs.constants.O_NOFOLLOW ?? 0) |
|
||||
(fs.constants.O_NONBLOCK ?? 0)
|
||||
)
|
||||
expect(toolCache.find).toHaveBeenCalledWith('kubectl', 'v1.27.15')
|
||||
expect(core.setOutput).toHaveBeenCalledWith(
|
||||
'kubectl-path',
|
||||
path.join('pathToCachedTool', 'kubectl')
|
||||
)
|
||||
})
|
||||
|
||||
test('run() - expands a major.minor version from version-file', async () => {
|
||||
mockInputs({version: '', 'version-file': '.tool-versions'})
|
||||
mockVersionFileContent('kubectl 1.27\n')
|
||||
vi.mocked(toolCache.downloadTool).mockResolvedValue('pathToStableTxt')
|
||||
vi.mocked(fs.readFileSync).mockReturnValue('v1.27.15')
|
||||
vi.mocked(toolCache.find).mockReturnValue('pathToCachedTool')
|
||||
vi.mocked(os.type).mockReturnValue('Linux')
|
||||
vi.mocked(fs.chmodSync).mockImplementation()
|
||||
|
||||
await expect(run.run()).resolves.toBeUndefined()
|
||||
|
||||
expect(toolCache.downloadTool).toHaveBeenCalledWith(
|
||||
'https://dl.k8s.io/release/stable-1.27.txt'
|
||||
)
|
||||
expect(toolCache.find).toHaveBeenCalledWith('kubectl', 'v1.27.15')
|
||||
})
|
||||
|
||||
test('run() - supports latest from version-file', async () => {
|
||||
mockInputs({version: '', 'version-file': '.tool-versions'})
|
||||
mockVersionFileContent('kubectl latest\n')
|
||||
vi.mocked(toolCache.downloadTool).mockResolvedValue('pathToStableTxt')
|
||||
vi.mocked(fs.readFileSync).mockReturnValue('v1.31.0')
|
||||
vi.mocked(toolCache.find).mockReturnValue('pathToCachedTool')
|
||||
vi.mocked(os.type).mockReturnValue('Linux')
|
||||
vi.mocked(fs.chmodSync).mockImplementation()
|
||||
|
||||
await expect(run.run()).resolves.toBeUndefined()
|
||||
|
||||
expect(toolCache.downloadTool).toHaveBeenCalledWith(
|
||||
'https://dl.k8s.io/release/stable.txt'
|
||||
)
|
||||
expect(toolCache.find).toHaveBeenCalledWith('kubectl', 'v1.31.0')
|
||||
})
|
||||
|
||||
test('run() - preserves a v-prefixed version from version-file', async () => {
|
||||
mockInputs({version: '', 'version-file': '.tool-versions'})
|
||||
mockVersionFileContent('kubectl v1.27.15\n')
|
||||
vi.mocked(toolCache.find).mockReturnValue('pathToCachedTool')
|
||||
vi.mocked(os.type).mockReturnValue('Linux')
|
||||
vi.mocked(fs.chmodSync).mockImplementation()
|
||||
|
||||
await expect(run.run()).resolves.toBeUndefined()
|
||||
|
||||
expect(toolCache.find).toHaveBeenCalledWith('kubectl', 'v1.27.15')
|
||||
expect(toolCache.downloadTool).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test.each(['../etc', '1.27%2Ffoo', '1.27.0;cmd'])(
|
||||
'run() - rejects malformed version-file value %s before download',
|
||||
async (value) => {
|
||||
mockInputs({version: '', 'version-file': '.tool-versions'})
|
||||
mockVersionFileContent(`kubectl ${value}\n`)
|
||||
|
||||
await expect(run.run()).rejects.toThrow('Invalid version format')
|
||||
|
||||
expect(toolCache.find).not.toHaveBeenCalled()
|
||||
expect(toolCache.downloadTool).not.toHaveBeenCalled()
|
||||
}
|
||||
)
|
||||
|
||||
test('run() - explicit version takes precedence over version-file', async () => {
|
||||
mockInputs({
|
||||
version: '1.30.0',
|
||||
'version-file': '.tool-versions'
|
||||
})
|
||||
vi.mocked(toolCache.find).mockReturnValue('pathToCachedTool')
|
||||
vi.mocked(os.type).mockReturnValue('Linux')
|
||||
vi.mocked(fs.chmodSync).mockImplementation()
|
||||
|
||||
await expect(run.run()).resolves.toBeUndefined()
|
||||
|
||||
expect(core.warning).toHaveBeenCalledWith(
|
||||
"Both 'version' and 'version-file' inputs are specified; using 'version'."
|
||||
)
|
||||
expect(fs.lstatSync).not.toHaveBeenCalled()
|
||||
expect(fs.readSync).not.toHaveBeenCalled()
|
||||
expect(toolCache.find).toHaveBeenCalledWith('kubectl', 'v1.30.0')
|
||||
})
|
||||
})
|
||||
|
||||
+16
-1
@@ -12,6 +12,7 @@ import {
|
||||
getLatestPatchVersion,
|
||||
isDefaultBaseURL,
|
||||
normalizeBaseURL,
|
||||
parseToolVersionsFile,
|
||||
secureDownload,
|
||||
validateBaseURL
|
||||
} from './helpers.js'
|
||||
@@ -20,7 +21,21 @@ const kubectlToolName = 'kubectl'
|
||||
const stableKubectlVersion = 'v1.15.0'
|
||||
|
||||
export async function run() {
|
||||
let version = core.getInput('version', {required: true})
|
||||
const versionFile = core.getInput('version-file')
|
||||
let version = core.getInput('version')
|
||||
|
||||
if (versionFile) {
|
||||
if (version && version.trim().toLowerCase() !== 'latest') {
|
||||
core.warning(
|
||||
"Both 'version' and 'version-file' inputs are specified; using 'version'."
|
||||
)
|
||||
} else {
|
||||
version = parseToolVersionsFile(versionFile)
|
||||
}
|
||||
}
|
||||
if (!version) {
|
||||
version = 'latest'
|
||||
}
|
||||
|
||||
const rawBaseURL = core.getInput('downloadBaseURL', {required: false}).trim()
|
||||
const downloadBaseURL = rawBaseURL || DEFAULT_KUBECTL_BASE_URL
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import {test, expect} from 'vitest'
|
||||
import * as fs from 'node:fs'
|
||||
import * as os from 'node:os'
|
||||
import * as path from 'node:path'
|
||||
import {spawnSync} from 'node:child_process'
|
||||
import {parseToolVersionsFile} from './helpers.js'
|
||||
|
||||
test('version-file reads a real regular file', () => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'kubectl-version-'))
|
||||
try {
|
||||
const file = path.join(dir, '.tool-versions')
|
||||
fs.writeFileSync(file, 'kubectl 1.27.15\n')
|
||||
expect(parseToolVersionsFile(file)).toBe('1.27.15')
|
||||
} finally {
|
||||
fs.rmSync(dir, {recursive: true, force: true})
|
||||
}
|
||||
})
|
||||
|
||||
test.skipIf(process.platform === 'win32')(
|
||||
'version-file rejects a FIFO swapped in after lstat without blocking',
|
||||
() => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'kubectl-fifo-'))
|
||||
try {
|
||||
const file = path.join(dir, '.tool-versions')
|
||||
fs.writeFileSync(file, 'kubectl 1.27.15\n')
|
||||
// Isolate a potentially blocking open in a child with a hard timeout.
|
||||
// Replace only lstat: open, fstat and the FIFO are real OS operations.
|
||||
const script = `
|
||||
const fs = require('node:fs');
|
||||
const {execFileSync} = require('node:child_process');
|
||||
const {syncBuiltinESMExports} = require('node:module');
|
||||
const file = ${JSON.stringify(file)};
|
||||
const lstat = fs.lstatSync;
|
||||
fs.lstatSync = function(p, options) {
|
||||
const stats = lstat(p, options);
|
||||
if (p === file) {
|
||||
fs.unlinkSync(file);
|
||||
execFileSync('mkfifo', [file]);
|
||||
}
|
||||
return stats;
|
||||
};
|
||||
syncBuiltinESMExports();
|
||||
import(${JSON.stringify(new URL('./helpers.ts', import.meta.url).href)})
|
||||
.then(({parseToolVersionsFile}) => {
|
||||
try {
|
||||
parseToolVersionsFile(file);
|
||||
process.exitCode = 1;
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
process.exitCode = /must be a regular file/.test(error.message) ? 0 : 1;
|
||||
}
|
||||
}).catch(error => { console.error(error); process.exitCode = 1; });
|
||||
`
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
['--experimental-strip-types', '-e', script],
|
||||
{encoding: 'utf8', timeout: 5000}
|
||||
)
|
||||
expect(result.error, result.stderr).toBeUndefined()
|
||||
expect(result.status, result.stderr).toBe(0)
|
||||
expect(result.stdout).toContain('must be a regular file')
|
||||
} finally {
|
||||
fs.rmSync(dir, {recursive: true, force: true})
|
||||
}
|
||||
},
|
||||
10000
|
||||
)
|
||||
Reference in New Issue
Block a user