From 9898d8c8713a993c9b9c18c368a61476794543e0 Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 11 Aug 2021 21:36:01 -0400 Subject: [PATCH] update-submodules: attempt to fix checkout issue, properly exit on errors A recent run failed to update luacov, but did not fail the workflow run: https://github.com/DFHack/dfhack/runs/3298049090?check_suite_focus=true ``` + git checkout dfhack error: pathspec 'dfhack' did not match any file(s) known to git ``` --- .github/workflows/update-submodules.yml | 3 +++ ci/update-submodules.bash | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index 0c2ab0325..45eaceb02 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -28,4 +28,7 @@ jobs: git config user.email "63161697+DFHack-Urist@users.noreply.github.com" if bash -x ci/update-submodules.bash; then git push --recurse-submodules=check + elif ! git diff --exit-code HEAD; then + echo "update-submodules.bash failed to commit changes" + exit 1 fi diff --git a/ci/update-submodules.bash b/ci/update-submodules.bash index 312d8f1d3..bebd9fe7d 100755 --- a/ci/update-submodules.bash +++ b/ci/update-submodules.bash @@ -21,6 +21,7 @@ write_msg "" cat ci/update-submodules.manifest | while read path branch; do cd "${git_root}/${path}" test "${git_root}" != "$(get_git_root)" + git fetch origin "${branch}:${branch}" git checkout "${branch}" git pull --ff-only cd "${git_root}"