fix: enhance submodule checkout process in CI workflow

This commit is contained in:
2026-05-17 16:29:49 +10:00
parent a28d3c26b5
commit fea9ebd501

View File

@@ -120,7 +120,19 @@ jobs:
- name: Checkout submodules manually - name: Checkout submodules manually
shell: powershell shell: powershell
run: | run: |
git submodule update --init --recursive git submodule sync --recursive
if (git submodule update --init --recursive) {
Write-Host "Submodules checked out at pinned commits."
exit 0
}
Write-Warning "Pinned submodule commit is unavailable on remote. Falling back to remote submodule HEAD."
git submodule deinit -f --all
git submodule update --init --recursive --remote
Write-Host "Resolved submodule commit:"
git -C cinny rev-parse HEAD
- name: Pull latest (after version bump) - name: Pull latest (after version bump)
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
@@ -176,9 +188,26 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: recursive submodules: false
ref: ${{ github.ref_name }} ref: ${{ github.ref_name }}
- name: Checkout submodules manually
run: |
set -euo pipefail
git submodule sync --recursive
if git submodule update --init --recursive; then
echo "Submodules checked out at pinned commits."
exit 0
fi
echo "Pinned submodule commit is unavailable on remote. Falling back to remote submodule HEAD."
git submodule deinit -f --all
git submodule update --init --recursive --remote
echo "Resolved submodule commit:"
git -C cinny rev-parse HEAD
- name: Pull latest (after version bump) - name: Pull latest (after version bump)
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
run: git pull origin main run: git pull origin main