From 89cfb6d2f183c12b6c9d94581565f39afb1ae1ed Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 7 Sep 2026 08:16:23 -0400 Subject: [PATCH] fix(update-flathub): conditionally update submodule --- .../workflows/__call-update-flathub-repo.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/__call-update-flathub-repo.yml b/.github/workflows/__call-update-flathub-repo.yml index 0cffedae..bc4e1ec9 100644 --- a/.github/workflows/__call-update-flathub-repo.yml +++ b/.github/workflows/__call-update-flathub-repo.yml @@ -136,10 +136,27 @@ jobs: "https://raw.githubusercontent.com/LizardByte/.github/master/.github/ISSUE_TEMPLATE/config.yml" \ ".github/ISSUE_TEMPLATE/config.yml" - - name: Update submodule + - name: Check if shared-modules submodule exists + id: check-submodule if: >- steps.check-label.outputs.hasTopic == 'true' && steps.check-release.outputs.isLatestRelease == 'true' + env: + SUBMODULE_PATH: packaging/linux/flatpak/deps/shared-modules + run: | + submodule_mode=$(git ls-tree HEAD -- "${SUBMODULE_PATH}" | cut -d ' ' -f 1) + # Git represents submodules as gitlinks with mode 160000. + if [ "${submodule_mode}" = "160000" ]; then + echo "exists=true" >> "${GITHUB_OUTPUT}" + else + echo "exists=false" >> "${GITHUB_OUTPUT}" + fi + + - name: Update submodule + if: >- + steps.check-label.outputs.hasTopic == 'true' && + steps.check-release.outputs.isLatestRelease == 'true' && + steps.check-submodule.outputs.exists == 'true' run: | # Get the current commit of the submodule in the main repository git submodule update --init packaging/linux/flatpak/deps/shared-modules