Skip to content

Commit fd5eb5e

Browse files
committed
🔊 Add GitHub Actions logging support
1 parent 26e9071 commit fd5eb5e

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

cmd/cmd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ func init() {
3232
Command.PersistentFlags().String("kubeconfig", kubeconfigDefault, "absolute path to the kubeconfig file")
3333
Command.PersistentFlags().StringP("namespace", "n", "", "the namespace scope for this CLI request")
3434

35+
Command.PersistentFlags().Bool("github-actions", false, "Enables GitHub Actions log output")
36+
_ = Command.PersistentFlags().MarkHidden("github-actions")
37+
3538
Command.AddCommand(
3639
exec.Command,
3740
dump.Command,

cmd/dump/dump.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bufio"
55
"bytes"
66
"compress/gzip"
7+
"fmt"
78
"github.com/clevyr/kubedb/internal/database/sqlformat"
89
"github.com/clevyr/kubedb/internal/kubernetes"
910
"github.com/clevyr/kubedb/internal/postgres"
@@ -111,6 +112,9 @@ func run(cmd *cobra.Command, args []string) (err error) {
111112
pr, pw := io.Pipe()
112113

113114
log.Println("Dumping \"" + postgresPod.Name + "\" to \"" + filename + "\"")
115+
if githubActions, _ := cmd.Flags().GetBool("github-actions"); githubActions {
116+
fmt.Println("::set-output name=filename::" + filename)
117+
}
114118

115119
ch := make(chan error)
116120
go func() {

0 commit comments

Comments
 (0)