Skip to content

Commit 2d19910

Browse files
authored
fix generation changelog if previous taf not set (#17)
* fix generation changelog if previous taf not set * update deps
1 parent 36bdb33 commit 2d19910

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

cmd/gcx/main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,15 @@ func getGitChangelog(from, to string) (string, error) {
309309
repoURL = strings.Replace(repoURL, "git@", "https://", 1)
310310
}
311311

312+
// If previous tag is not set, return empty changelog without error
313+
if from == "0.0.0" || from == "" {
314+
return "", nil
315+
}
316+
312317
// Get all commits between tags
313318
cmd := exec.Command("git", "log",
314-
"--pretty=format:* %s by @%an in %h", // Format each commit as a markdown list item with author and short hash
315-
fmt.Sprintf("%s..%s", from, to)) // From older to newer tag
319+
"--pretty=format:* %s by @%an in %h",
320+
fmt.Sprintf("%s..%s", from, to))
316321
out, err := cmd.Output()
317322
if err != nil {
318323
return "", fmt.Errorf("failed to get git log: %w", err)

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/containrrr/shoutrrr v0.8.0
77
github.com/joho/godotenv v1.5.1
88
github.com/melbahja/goph v1.4.0
9-
github.com/minio/minio-go/v7 v7.0.88
9+
github.com/minio/minio-go/v7 v7.0.89
1010
github.com/urfave/cli/v2 v2.27.6
1111
gopkg.in/yaml.v3 v3.0.1
1212
)
@@ -26,12 +26,12 @@ require (
2626
github.com/minio/crc64nvme v1.0.1 // indirect
2727
github.com/minio/md5-simd v1.1.2 // indirect
2828
github.com/pkg/errors v0.9.1 // indirect
29-
github.com/pkg/sftp v1.13.8 // indirect
29+
github.com/pkg/sftp v1.13.9 // indirect
3030
github.com/rs/xid v1.6.0 // indirect
3131
github.com/russross/blackfriday/v2 v2.1.0 // indirect
3232
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
3333
golang.org/x/crypto v0.36.0 // indirect
34-
golang.org/x/net v0.37.0 // indirect
34+
golang.org/x/net v0.38.0 // indirect
3535
golang.org/x/sys v0.31.0 // indirect
3636
golang.org/x/text v0.23.0 // indirect
3737
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY
4646
github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
4747
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
4848
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
49-
github.com/minio/minio-go/v7 v7.0.88 h1:v8MoIJjwYxOkehp+eiLIuvXk87P2raUtoU5klrAAshs=
50-
github.com/minio/minio-go/v7 v7.0.88/go.mod h1:33+O8h0tO7pCeCWwBVa07RhVVfB/3vS4kEX7rwYKmIg=
49+
github.com/minio/minio-go/v7 v7.0.89 h1:hx4xV5wwTUfyv8LarhJAwNecnXpoTsj9v3f3q/ZkiJU=
50+
github.com/minio/minio-go/v7 v7.0.89/go.mod h1:2rFnGAp02p7Dddo1Fq4S2wYOfpF0MUTSeLTRC90I204=
5151
github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
5252
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
5353
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
5454
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
5555
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
5656
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
5757
github.com/pkg/sftp v1.13.5/go.mod h1:wHDZ0IZX6JcBYRK1TH9bcVq8G7TLpVHYIGJRFnmPfxg=
58-
github.com/pkg/sftp v1.13.8 h1:Xt7eJ/xqXv7s0VuzFw7JXhZj6Oc1zI6l4GK8KP9sFB0=
59-
github.com/pkg/sftp v1.13.8/go.mod h1:DmvEkvKE2lshEeuo2JMp06yqcx9HVnR7e3zqQl42F3U=
58+
github.com/pkg/sftp v1.13.9 h1:4NGkvGudBL7GteO3m6qnaQ4pC0Kvf0onSVc9gR3EWBw=
59+
github.com/pkg/sftp v1.13.9/go.mod h1:OBN7bVXdstkFFN/gdnHPUb5TE8eb8G1Rp9wCItqjkkA=
6060
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6161
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6262
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
@@ -99,8 +99,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
9999
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
100100
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
101101
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
102-
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
103-
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
102+
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
103+
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
104104
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
105105
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
106106
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

0 commit comments

Comments
 (0)