From d35389a822b2c4ea1d17da6b3a82604260b14f45 Mon Sep 17 00:00:00 2001 From: Vasiliy Vasilyuk Date: Sat, 21 Sep 2024 18:35:14 +0300 Subject: [PATCH] 1 --- .github/workflows/shell.yml | 2 ++ go-mod-bump.sh | 26 +------------------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml index a39d832..87f0871 100644 --- a/.github/workflows/shell.yml +++ b/.github/workflows/shell.yml @@ -55,6 +55,7 @@ jobs: ../go-mod-bump.sh go git diff --exit-code dc67e0b4138c3487d3b4d5f012b6a3262d2db25e && exit 0 || true echo "No changes have been detected, but they must be" + exit 1 - name: Test bump modules version working-directory: tornado @@ -63,3 +64,4 @@ jobs: ../go-mod-bump.sh all git diff --exit-code dc67e0b4138c3487d3b4d5f012b6a3262d2db25e && exit 0 || true echo "No changes have been detected, but they must be" + exit 1 diff --git a/go-mod-bump.sh b/go-mod-bump.sh index 534de1a..c172cd8 100755 --- a/go-mod-bump.sh +++ b/go-mod-bump.sh @@ -110,28 +110,4 @@ function update_module() { go build ./... } -function bump_module() { - module=$(echo "$1" | cut -f1 -d@) - current_version=$(echo "$1" | cut -f2 -d@) - latest_version=$(echo "$1" | cut -f3 -d@) - - if ! update_module "${module}@${latest_version}" >/dev/null 2>&1 >/dev/null; then - echoerr "go-mod-bump: failed to update module ${module} from ${current_version} to ${latest_version}" - echoerr "try to update module manually using commands:" - echoerr "go get ${module}@${latest_version}" - echoerr "go mod tidy" - echoerr "go build ./..." - git checkout -f HEAD -- go.mod go.sum - return - fi - - git reset HEAD -- . >/dev/null - git add go.mod go.sum >/dev/null - git commit -a -m "${PREFIX}Bump ${module} from ${current_version} to ${latest_version}" >/dev/null - - echoerr "go-mod-bump: upgraded ${module} ${current_version} => [${latest_version}]" -} - -for mdl in $MODULES_FOR_UPDATE; do - (bump_module "$mdl") -done +echo "DO NOTHING"