mirror of
https://github.com/selfxyz/self.git
synced 2026-01-08 22:28:11 -05:00
chore: sanitise node version (#1026)
This commit is contained in:
20
.github/workflows/circuits-build.yml
vendored
20
.github/workflows/circuits-build.yml
vendored
@@ -110,11 +110,23 @@ jobs:
|
||||
- name: Add Circom to PATH
|
||||
run: echo "$HOME/.cache/circom" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v5
|
||||
- name: Read and sanitize Node.js version
|
||||
shell: bash
|
||||
run: |
|
||||
if [ ! -f .nvmrc ] || [ -z "$(cat .nvmrc)" ]; then
|
||||
echo "❌ .nvmrc is missing or empty"; exit 1;
|
||||
fi
|
||||
VERSION="$(tr -d '\r\n' < .nvmrc)"
|
||||
VERSION="${VERSION#v}"
|
||||
if ! [[ "$VERSION" =~ ^[0-9]+(\.[0-9]+){0,2}$ ]]; then
|
||||
echo "Invalid .nvmrc content: '$VERSION'"; exit 1;
|
||||
fi
|
||||
echo "NODE_VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||
echo "NODE_VERSION_SANITIZED=${VERSION//\//-}" >> "$GITHUB_ENV"
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: 'yarn'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm i -g yarn
|
||||
|
||||
Reference in New Issue
Block a user