From f786c93d46250e90a46c744ca902c2da9ffbba2b Mon Sep 17 00:00:00 2001 From: nomadics9 Date: Tue, 7 Jan 2025 15:39:07 +0300 Subject: [PATCH] Dont bump App version if same --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index e87c6d7..56af857 100644 --- a/main.go +++ b/main.go @@ -24,11 +24,6 @@ func updateVersion(repoPath string, serviceName string) (string, error) { botToken := os.Getenv("BOT_TOKEN") chatid := os.Getenv("CHAT_ID") - if serviceName == "alaskartv" { - versionPath = fmt.Sprintf("%s/release.txt", repoPath) - bumpVersionTv(repoPath) - } - currentVersion, err := os.ReadFile(versionPath) if err != nil { return "", fmt.Errorf("failed to read version file: %w", err) @@ -50,6 +45,11 @@ func updateVersion(repoPath string, serviceName string) (string, error) { return string(jsonResponse), nil } + if serviceName == "alaskartv" { + versionPath = fmt.Sprintf("%s/release.txt", repoPath) + bumpVersionTv(repoPath) + } + os.WriteFile(versionPath, []byte(newVersion), 0644) cmds := [][]string{ {"git", "-C", repoPath, "add", "."}, @@ -83,7 +83,7 @@ func updateVersion(repoPath string, serviceName string) (string, error) { return "", fmt.Errorf("failed to marshal JSON: %w", err) } return string(jsonResponse), nil -} + } func bumpVersionTv(repoPath string) { filePath := fmt.Sprintf("%s/version.txt", repoPath)