From 6db48280fdf5aa98388f6e001977c2b3d6d4e0b2 Mon Sep 17 00:00:00 2001 From: dhruvjoshi Date: Thu, 2 May 2024 12:14:49 +0530 Subject: [PATCH] INFRA-3209 | Dhruv | update check failure condition --- .github/workflows/kutegen_submodule_check.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kutegen_submodule_check.yml b/.github/workflows/kutegen_submodule_check.yml index 7441e63b..7adb3018 100644 --- a/.github/workflows/kutegen_submodule_check.yml +++ b/.github/workflows/kutegen_submodule_check.yml @@ -30,12 +30,8 @@ jobs: git fetch origin main BEHIND=$(git rev-list origin/main ^HEAD --count) AHEAD=$(git rev-list HEAD ^origin/main --count) - if [ $AHEAD -gt 2 ]; then - echo "Submodule is more than 2 commits ahead of main branch." + if [ $AHEAD -ne 0] || [$BEHIND -ne 0 ]; then + echo "Submodule is not up to date with main branch." exit 1 - elif [ $BEHIND -gt 2 ]; then - echo "Submodule is more than 2 commits behind main branch." - exit 1 - else - echo "Submodule is within 2 commits of main branch." fi + echo "Submodule is up to date with main branch." \ No newline at end of file