Skip to content

Commit 3edbc31

Browse files
committed
feat: downgrade to setup-node v4
1 parent 1f70696 commit 3edbc31

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/actions/build-node-python/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,11 @@ runs:
104104
if: inputs.enable_node == 'true' && inputs.node_version == ''
105105
id: get-node-version
106106
- name: Set up node version
107-
uses: actions/setup-node@v5
107+
uses: actions/setup-node@v4
108108
if: inputs.enable_node == 'true'
109109
with:
110110
node-version: ${{ inputs.node_version || fromJson(steps.get-node-version.outputs.node_version) }}
111111
registry-url: ${{ inputs.npm_registry || 'https://registry.npmjs.org/' }}
112-
package-manager-cache: false
113112
- name: Show node and npm version
114113
if: inputs.enable_node == 'true'
115114
run: |

.github/actions/get-node-version/action.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@ runs:
1313
- name: Setup sandboxed dependencies
1414
shell: bash
1515
run: |
16-
npm init -y --prefix ${{ github.action_path }} >/dev/null 2>&1
17-
npm install semver --prefix ${{ github.action_path }} >/dev/null 2>&1
16+
cd ${{ github.action_path }}
17+
mkdir temp
18+
cd temp
19+
npm init -y
20+
npm install semver
1821
1922
- name: Find version script
2023
id: get-node-version
21-
uses: actions/github-script@v7
24+
uses: actions/github-script@v8
2225
with:
2326
script: |
2427
const path = require('path');
2528
const fs = require('fs');
2629
// Load the sandboxed semver dependency from the action's own node_modules
27-
const semver = require(path.join(process.env.GITHUB_ACTION_PATH, 'node_modules/semver'));
30+
const semver = require(path.join(process.env.GITHUB_ACTION_PATH, 'temp/node_modules/semver'));
2831
2932
const defaultVersion = '20.9';
3033
@@ -56,3 +59,9 @@ runs:
5659
5760
core.setFailed(`\nNo compatible Node.js version found in the list of versions "${versionsToCheck.join(', ')}" for range "${requiredRange}". Returning default version ${defaultVersion}.`);
5861
return defaultVersion;
62+
63+
- name: Cleanup sandbox
64+
shell: bash
65+
run: |
66+
cd ${{ github.action_path }}
67+
rm -rf temp

0 commit comments

Comments
 (0)