Dont bump App version if same

This commit is contained in:
nomadics9 2025-01-07 15:39:07 +03:00
parent 4186d7fb3c
commit f786c93d46
No known key found for this signature in database

10
main.go
View file

@ -24,11 +24,6 @@ func updateVersion(repoPath string, serviceName string) (string, error) {
botToken := os.Getenv("BOT_TOKEN") botToken := os.Getenv("BOT_TOKEN")
chatid := os.Getenv("CHAT_ID") chatid := os.Getenv("CHAT_ID")
if serviceName == "alaskartv" {
versionPath = fmt.Sprintf("%s/release.txt", repoPath)
bumpVersionTv(repoPath)
}
currentVersion, err := os.ReadFile(versionPath) currentVersion, err := os.ReadFile(versionPath)
if err != nil { if err != nil {
return "", fmt.Errorf("failed to read version file: %w", err) 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 return string(jsonResponse), nil
} }
if serviceName == "alaskartv" {
versionPath = fmt.Sprintf("%s/release.txt", repoPath)
bumpVersionTv(repoPath)
}
os.WriteFile(versionPath, []byte(newVersion), 0644) os.WriteFile(versionPath, []byte(newVersion), 0644)
cmds := [][]string{ cmds := [][]string{
{"git", "-C", repoPath, "add", "."}, {"git", "-C", repoPath, "add", "."},