Skip to content

Commit

Permalink
Merge pull request #6 from skilld-labs/publish-error-standard-input-i…
Browse files Browse the repository at this point in the history
…s-not-a-terminal-while-run-in-ci

do not try to connect to tty if creds are provided
  • Loading branch information
davidferlay authored Mar 4, 2024
2 parents 6a8eb6a + 7436907 commit a91ed8f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,14 @@ func getCredentials(url, username, password string, k keyring.Keyring) (keyring.
ci.URL = url
ci.Username = username
ci.Password = password
if ci.URL != "" && (ci.Username == "" || ci.Password == "") {
cli.Println("Please add login and password for URL - %s", ci.URL)
}
err = keyring.RequestCredentialsFromTty(&ci)
if err != nil {
return ci, false, err
if ci.Username == "" || ci.Password == "" {
if ci.URL != "" {
cli.Println("Please add login and password for URL - %s", ci.URL)
}
err = keyring.RequestCredentialsFromTty(&ci)
if err != nil {
return ci, false, err
}
}

err = k.AddItem(ci)
Expand Down

0 comments on commit a91ed8f

Please sign in to comment.