Skip to content

Provide a output for the selected Node.js version #150

Closed
@LinusU

Description

@LinusU

It would be great if there could be an output that tells which exact version of Node.js was installed.

An example use case for this is cacheing node_modules, which is only valid for the same OS + Node.js version + package-lock combination:

name: Node CI

on:
  pull_request:
    branches:
    - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Setup Node.js
      id: setup-node
      uses: actions/setup-node@v1
      with:
        node-version: 12.15.0

    - name: Cache dependencies
      id: cache-node-modules
      uses: actions/cache@v1
      with:
        path: node_modules
        key: ${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }}

    - name: Install dependencies
      run: npm ci
      if: steps.cache-node-modules.outputs.cache-hit != 'true'

    - name: Tets
      run: npm test

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions