From c9c990c874bd7bea66c6f0dfe2196cad238a40ed Mon Sep 17 00:00:00 2001
From: GrantBirki <grantbirki@github.com>
Date: Tue, 31 Oct 2023 17:07:09 -0600
Subject: [PATCH] use a .node-version file

---
 .github/workflows/check-dist.yml | 13 ++++---------
 .github/workflows/ci.yml         |  2 +-
 .github/workflows/linter.yml     |  2 +-
 .node-version                    |  1 +
 README.md                        |  8 ++++++--
 5 files changed, 13 insertions(+), 13 deletions(-)
 create mode 100644 .node-version

diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml
index 4d7f663..444f1a9 100644
--- a/.github/workflows/check-dist.yml
+++ b/.github/workflows/check-dist.yml
@@ -12,22 +12,17 @@ on:
   push:
     branches:
       - main
-    paths-ignore:
-      - '**.md'
   pull_request:
-    paths-ignore:
-      - '**.md'
   workflow_dispatch:
 
+permissions:
+  contents: read
+
 jobs:
   check-dist:
     name: Check dist/
     runs-on: ubuntu-latest
 
-    permissions:
-      contents: read
-      statuses: write
-
     steps:
       - name: Checkout
         id: checkout
@@ -36,7 +31,7 @@ jobs:
       - name: Setup Node.js
         uses: actions/setup-node@v4
         with:
-          node-version: 18
+          node-version-file: .node-version
           cache: npm
 
       - name: Install Dependencies
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 44d8339..f4126e7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -21,7 +21,7 @@ jobs:
         id: setup-node
         uses: actions/setup-node@v4
         with:
-          node-version: 18
+          node-version-file: .node-version
           cache: npm
 
       - name: Install Dependencies
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index bc00bf0..ed9ec48 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -27,7 +27,7 @@ jobs:
         id: setup-node
         uses: actions/setup-node@v4
         with:
-          node-version: 18
+          node-version-file: .node-version
           cache: npm
 
       - name: Install Dependencies
diff --git a/.node-version b/.node-version
new file mode 100644
index 0000000..1cc433a
--- /dev/null
+++ b/.node-version
@@ -0,0 +1 @@
+20.6.0
diff --git a/README.md b/README.md
index fcbe0f7..9a87130 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,10 @@ need to perform some initial setup steps before you can develop your action.
 > [`nvm`](https://github.com/nvm-sh/nvm), you can run `nodenv install` in the
 > root of your repository to install the version specified in
 > [`package.json`](./package.json). Otherwise, 20.x or later should work!
+> This template has a `.node-version` file at the root of the repository that
+> will be used by `nodenv` or `nvm` to automatically switch to the correct
+> version of Node.js when you `cd` into the repository. Additionally, this
+> `.node-version` file is used by GitHub Actions in a few CI jobs.
 
 1. :hammer_and_wrench: Install the dependencies
 
@@ -44,13 +48,13 @@ need to perform some initial setup steps before you can develop your action.
    npm install
    ```
 
-1. :building_construction: Package the TypeScript for distribution
+2. :building_construction: Package the TypeScript for distribution
 
    ```bash
    npm run bundle
    ```
 
-1. :white_check_mark: Run the tests
+3. :white_check_mark: Run the tests
 
    ```bash
    $ npm test