Skip to content
Myr

[actions] fall back to the canonical nvmrc submodule when a fork lacks its own

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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 `<owner>/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.

authored by Jordan Harband · committed by Jordan Harband · parent 1889911 · Browse files · 4 files+36 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+36 added−0 removed

  • other:+36 added−0 removed

4 files+36 added−0 removed

modified:.github/workflows/tests-fast.yml+9 added
modified:.github/workflows/tests-installation-iojs.yml+9 added
37 unmodified lines
38 iojs.org:44339 azure.archive.ubuntu.com:8040 packages.microsoft.com:44341 - uses: actions/checkout@v642 id: checkout43 continue-on-error: true44 with:45 submodules: true46 - name: 'nvmrc submodule fallback (forks without their own nvmrc)'47 if: steps.checkout.outcome == 'failure'48 shell: bash49 run: |50 git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git51 git submodule sync --recursive52 git submodule update --init --recursive53 - name: Install zsh and additional shells54 run: |55 sudo apt-get update56 sudo apt-get install -y zsh
52 unmodified lines
modified:.github/workflows/tests-installation-node.yml+9 added
43 unmodified lines
44 production.cloudfront.docker.com:44345 registry-1.docker.io:44346 auth.docker.io:44347 - uses: actions/checkout@v648 id: checkout49 continue-on-error: true50 with:51 submodules: true52 - name: 'nvmrc submodule fallback (forks without their own nvmrc)'53 if: steps.checkout.outcome == 'failure'54 shell: bash55 run: |56 git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git57 git submodule sync --recursive58 git submodule update --init --recursive59 - uses: ljharb/actions/node/install@main60 name: 'npm install && version checks'61 with:62 node-version: 'lts/*'
76 unmodified lines
modified:.github/workflows/tests-xenial.yml+9 added
40 unmodified lines
41 production.cloudfront.docker.com:44342 registry-1.docker.io:44343 auth.docker.io:44344 - uses: actions/checkout@v645 id: checkout46 continue-on-error: true47 with:48 submodules: true49 - name: 'nvmrc submodule fallback (forks without their own nvmrc)'50 if: steps.checkout.outcome == 'failure'51 shell: bash52 run: |53 git submodule set-url test/fixtures/nvmrc https://github.com/nvm-sh/nvmrc.git54 git submodule sync --recursive55 git submodule update --init --recursive56 - uses: ljharb/actions/node/install@main57 name: 'npm install && version checks'58 with:59 node-version: 'lts/*'
69 unmodified lines