Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Node.JS version pinned at `engines` in `package.json` on GitHub Actions Workflow
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# extract `engines.node` from package.json and save it to output
- name: Get Node.JS version from package.json
id: get-versions
run: echo ::set-output name=node::$(jq -r .engines.node ./package.json)
- uses: actions/setup-node@v1
with:
node-version: ${{steps.get-versions.outputs.node}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.