This repository was archived by the owner on May 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed
Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change 2323 name : Docker Login
2424 uses : docker/login-action@v1
2525 with :
26- username : ${{ secrets.DOCKERHUB_USERNAME }}
27- password : ${{ secrets.DOCKERHUB_TOKEN }}
26+ registry : ghcr.io
27+ username : ${{ github.repository_owner }}
28+ password : ${{ secrets.CODE_STREAM_CLI_BUILD_TOKEN }}
2829 -
2930 name : Set up Go
3031 uses : actions/setup-go@v2
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ func testAccessToken() bool {
7777 log .Warnln (err )
7878 return false
7979 }
80- log .Debugln (queryResponse .RawResponse )
80+ // log.Debugln(queryResponse.RawResponse)
8181 if queryResponse .StatusCode () == 401 {
8282 log .Debugln ("Access Token Expired" )
8383 return false
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ package cmd
66
77import (
88 "errors"
9- "fmt "
9+ "io/ioutil "
1010 "os"
1111 "strings"
1212
@@ -131,14 +131,30 @@ var createPipelineCmd = &cobra.Command{
131131 if err := ensureTargetConnection (); err != nil {
132132 log .Fatalln (err )
133133 }
134-
135- if importPath != "" {
136- err := importYaml (importPath , "create" )
134+ // Read importPath
135+ stat , err := os .Stat (importPath )
136+ if err == nil && stat .IsDir () {
137+ log .Debugln ("importPath is a directory" )
138+ files , err := ioutil .ReadDir (importPath )
137139 if err != nil {
138- log .Fatalln ("Failed to import Pipeline" , err )
140+ log .Fatal (err )
141+ }
142+ for _ , f := range files {
143+ if strings .Contains (f .Name (), ".yaml" ) || strings .Contains (f .Name (), ".yml" ) {
144+ log .Println (f .Name ())
145+ }
139146 }
140- fmt .Println ("Imported successfully, Pipeline created." )
147+ } else {
148+ log .Debugln ("importPath is a file" )
141149 }
150+
151+ // if importPath != "" {
152+ // err := importYaml(importPath, "create")
153+ // if err != nil {
154+ // log.Fatalln("Failed to import Pipeline", err)
155+ // }
156+ // fmt.Println("Imported successfully, Pipeline created.")
157+ // }
142158 },
143159}
144160
You can’t perform that action at this time.
0 commit comments