node-version-file で必須チェック名が変わる

node-version だと build (20.x) になり、上げるたびに保護ルールの更新が要る。

  • #GitHub Actions
  • #Node.js

node-version: "20.x" だとステータス名が build (20.x) (push) になる。バージョンを上げると保護ルールの必須チェック名がずれる。

node-version-file なら build (push) のまま。ローカルと CI の Node も同じファイルを見る。

yaml
- uses: actions/setup-node@v4
  with:
    node-version-file: package.json

.nvmrc.node-version でもよい。

編集