Skip to content

Use engines.node as source of version data for "actions/setup-node" action #413

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

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
Follow the installation instructions here:<br />
https://nodejs.dev/download

Node.js 20.x is used for development of this project. [nvm](https://github.com/nvm-sh/nvm) is recommended to easily switch between Node.js versions.
The **Node.js** version in use is defined in the `engines.node` field of [`package.json`](../package.json).

[nvm](https://github.com/nvm-sh/nvm) is recommended to easily switch between Node.js versions.

### 2. Install dependencies

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-npm.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Check npm

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 20.x

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
Expand Down Expand Up @@ -162,7 +158,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install dependencies
run: npm install
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-packaging-ncc-typescript-npm.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Check Packaging

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 20.x

on:
push:
paths:
Expand Down Expand Up @@ -35,7 +31,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install dependencies
run: npm install
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Test Action

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 20.x

on:
push:
pull_request:
Expand Down Expand Up @@ -31,7 +27,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: npm install
run: npm install
Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
"prettier": "^3.3.3",
"ts-jest": "^28.0.8",
"typescript": "^5.6.2"
},
"engines": {
"node": "20.x"
}
}
Loading