From c35ab264180bfccba5674ebbdc2bc1439b700e82 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 18 Nov 2026 17:32:04 +0100 Subject: [PATCH 1/2] fix: Require Node 22 to match inject-markdown; add test workflow --- .github/actions/setup/action.yaml | 2 +- .github/workflows/test.yml | 52 ++++++++++++++++++++ .github/workflows/update-dependencies.yml | 2 +- .github/workflows/update-inject-markdown.yml | 2 +- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index a9f61cc..50a8930 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -4,7 +4,7 @@ inputs: node-version: required: false description: The version of Node to use. - default: "18.x" + default: "22.x" runs: using: "composite" steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2c87610 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,52 @@ +name: " 🧪 Test" +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +jobs: + test-node-versions: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node-version: + - 22.x + - 24.x + - 25.x + os: + - ubuntu-latest + + include: + - os: windows-latest + node-version: 24.x + + steps: + - uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + with: + node-version: ${{ matrix.node-version }} + + - run: npm ci --omit=dev + - run: npm test + + # Ensure the repository is clean after build & test + - run: git --no-pager diff --compact-summary --exit-code + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup + uses: ./.github/actions/setup + + - run: npm ci + - run: npx prettier --check . diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml index 8a8015b..0955741 100644 --- a/.github/workflows/update-dependencies.yml +++ b/.github/workflows/update-dependencies.yml @@ -40,7 +40,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 18.x + node-version: 22.x - name: Update Root run: | diff --git a/.github/workflows/update-inject-markdown.yml b/.github/workflows/update-inject-markdown.yml index 1176a02..e6feb22 100644 --- a/.github/workflows/update-inject-markdown.yml +++ b/.github/workflows/update-inject-markdown.yml @@ -40,7 +40,7 @@ jobs: - name: Setup uses: ./.github/actions/setup with: - node-version: 18.x + node-version: 22.x - name: Install run: | diff --git a/package-lock.json b/package-lock.json index a947f4d..d2dd249 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "prettier": "^3.10.1" }, "engines": { - "node": ">=18" + "node": ">=22" } }, "node_modules/@types/debug": { diff --git a/package.json b/package.json index cf2658a..b5384f7 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "index.js" ], "engines": { - "node": ">=18" + "node": ">=22" }, "dependencies": { "inject-markdown": "^6.3.0" From 866e908a765fe180a08641c07c445d2d84685578 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Wed, 18 Nov 2026 18:50:40 +0100 Subject: [PATCH 2/2] ci: Keep LF line endings so the Windows test leaves a clean tree --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9621b8b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# Check out with LF on every platform. inject-markdown writes LF, so CRLF checkouts +# (Windows) would show every injected file as changed. +* text=auto eol=lf