Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force nodejs version in github action workflow #182

Open
reboottime opened this issue Dec 1, 2023 · 2 comments
Open

Force nodejs version in github action workflow #182

reboottime opened this issue Dec 1, 2023 · 2 comments

Comments

@reboottime
Copy link
Owner

reboottime commented Dec 1, 2023

Overview

  1. Recap on some basic Github actions commands
  2. Force github action uses you preferred nodejs version
@reboottime
Copy link
Owner Author

Recap on Github actions

@reboottime
Copy link
Owner Author

Force Github action use specific node version

  1. Setup the nodejs version in your package.json engines property:
  "engines": {
    "node": ">=18.16.0"
  },```
  
  
  2. Apply set up node version action
  
  ```sh
      - name: Get Node.js version
        run: |
          NODE_VERSION=$(jq -r '.engines.node' package.json)
          echo "NODE_VERSION=${NODE_VERSION}" >> $GITHUB_ENV
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}
          
          ```
  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant