CodexBloom - Programming Q&A Platform

GitHub Actions not using correct Node.js version despite setup in .yml file

👀 Views: 294 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-17
github-actions nodejs ci-cd yaml

I'm upgrading from an older version and I'm experiencing an scenario where my GitHub Actions workflow is not using the specified Node.js version from my `.yml` setup... I have the following configuration in my `.github/workflows/nodejs.yml`: ```yaml name: Node.js CI on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Node.js uses: actions/setup-node@v2 with: node-version: '14.x' - name: Install Dependencies run: npm install - name: Run Tests run: npm test ``` However, when I check the logs, it shows that it's using Node.js version 12.x: `Node.js version: 12.22.1`. I've tried clearing the cache and even triggering the workflow manually, but it still defaults to the older version. I double-checked the `node-version` field, and it appears correct. Am I missing something in my configuration, or is there a known scenario with the `setup-node` action? Any insights on how to resolve this would be greatly appreciated. The project is a service built with Yaml. Any suggestions would be helpful.