From 77fca77ddd25bfafdf2fedf1ac211ab5b8a09e78 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 4 Jun 2026 09:22:04 -0700 Subject: [PATCH] [actions] fall back to the canonical nvmrc submodule when a fork lacks its own Upstream's `.gitmodules` uses a relative submodule url (`../nvmrc.git`), which resolves against the superproject's origin: on a fork without its own `nvmrc` fork that is `/nvmrc`, which 404s and fails `actions/checkout` with `submodules: true`. Keep `submodules: true` (so a fork's own `nvmrc` is used when present), but mark checkout `continue-on-error` and, only when it failed, re-point the submodule at `nvm-sh/nvmrc` and update. --- .github/workflows/tests-fast.yml | 9 +++++++++ .github/workflows/tests-installation-iojs.yml | 9 +++++++++ .github/workflows/tests-installation-node.yml | 9 +++++++++ .github/workflows/tests-xenial.yml | 9 +++++++++ 4 files changed, 36 insertions(+) diff --git a/.github/workflows/tests-fast.yml b/.github/workflows/tests-fast.yml index 8b0eed73..e6bec6b9 100644 --- a/.github/workflows/tests-fast.yml +++ b/.github/workflows/tests-fast.yml @@ -47,8 +47,17 @@ jobs: production.cloudflare.docker.com:443 production.cloudfront.docker.com:443 - uses: actions/checkout@v6 + id: checkout + continue-on-error: true with: submodules: true + - name: 'nvmrc submodule fallback (forks without their own nvmrc)' + if: steps.checkout.outcome == 'failure' + shell: bash + run: | + git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git + git submodule sync --recursive + git submodule update --init --recursive - name: Install zsh, additional shells, and awk variant run: | sudo apt-get update diff --git a/.github/workflows/tests-installation-iojs.yml b/.github/workflows/tests-installation-iojs.yml index 3d0c37ec..941b9681 100644 --- a/.github/workflows/tests-installation-iojs.yml +++ b/.github/workflows/tests-installation-iojs.yml @@ -39,8 +39,17 @@ jobs: azure.archive.ubuntu.com:80 packages.microsoft.com:443 - uses: actions/checkout@v6 + id: checkout + continue-on-error: true with: submodules: true + - name: 'nvmrc submodule fallback (forks without their own nvmrc)' + if: steps.checkout.outcome == 'failure' + shell: bash + run: | + git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git + git submodule sync --recursive + git submodule update --init --recursive - name: Install zsh and additional shells run: | sudo apt-get update diff --git a/.github/workflows/tests-installation-node.yml b/.github/workflows/tests-installation-node.yml index c1d44874..ef53c15f 100644 --- a/.github/workflows/tests-installation-node.yml +++ b/.github/workflows/tests-installation-node.yml @@ -45,8 +45,17 @@ jobs: registry-1.docker.io:443 auth.docker.io:443 - uses: actions/checkout@v6 + id: checkout + continue-on-error: true with: submodules: true + - name: 'nvmrc submodule fallback (forks without their own nvmrc)' + if: steps.checkout.outcome == 'failure' + shell: bash + run: | + git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git + git submodule sync --recursive + git submodule update --init --recursive - uses: ljharb/actions/node/install@main name: 'npm install && version checks' with: diff --git a/.github/workflows/tests-xenial.yml b/.github/workflows/tests-xenial.yml index ed12b091..ca946c50 100644 --- a/.github/workflows/tests-xenial.yml +++ b/.github/workflows/tests-xenial.yml @@ -42,8 +42,17 @@ jobs: registry-1.docker.io:443 auth.docker.io:443 - uses: actions/checkout@v6 + id: checkout + continue-on-error: true with: submodules: true + - name: 'nvmrc submodule fallback (forks without their own nvmrc)' + if: steps.checkout.outcome == 'failure' + shell: bash + run: | + git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git + git submodule sync --recursive + git submodule update --init --recursive - uses: ljharb/actions/node/install@main name: 'npm install && version checks' with: