mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-06-06 06:17:09 +08:00
[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 `<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.
This commit is contained in:
9
.github/workflows/tests-fast.yml
vendored
9
.github/workflows/tests-fast.yml
vendored
@@ -47,8 +47,17 @@ jobs:
|
|||||||
production.cloudflare.docker.com:443
|
production.cloudflare.docker.com:443
|
||||||
production.cloudfront.docker.com:443
|
production.cloudfront.docker.com:443
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
id: checkout
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
submodules: true
|
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
|
- name: Install zsh, additional shells, and awk variant
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|||||||
@@ -39,8 +39,17 @@ jobs:
|
|||||||
azure.archive.ubuntu.com:80
|
azure.archive.ubuntu.com:80
|
||||||
packages.microsoft.com:443
|
packages.microsoft.com:443
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
id: checkout
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
submodules: true
|
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
|
- name: Install zsh and additional shells
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|||||||
@@ -45,8 +45,17 @@ jobs:
|
|||||||
registry-1.docker.io:443
|
registry-1.docker.io:443
|
||||||
auth.docker.io:443
|
auth.docker.io:443
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
id: checkout
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
submodules: true
|
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
|
- uses: ljharb/actions/node/install@main
|
||||||
name: 'npm install && version checks'
|
name: 'npm install && version checks'
|
||||||
with:
|
with:
|
||||||
|
|||||||
9
.github/workflows/tests-xenial.yml
vendored
9
.github/workflows/tests-xenial.yml
vendored
@@ -42,8 +42,17 @@ jobs:
|
|||||||
registry-1.docker.io:443
|
registry-1.docker.io:443
|
||||||
auth.docker.io:443
|
auth.docker.io:443
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
id: checkout
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
submodules: true
|
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
|
- uses: ljharb/actions/node/install@main
|
||||||
name: 'npm install && version checks'
|
name: 'npm install && version checks'
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user