more explicit success message
This commit is contained in:
parent
2e6639fe78
commit
e1e838c281
2 changed files with 18 additions and 7 deletions
|
|
@ -67,10 +67,10 @@ func removeRun(opts *RemoveOptions) error {
|
|||
}
|
||||
|
||||
var path string
|
||||
if opts.OrgName == "" {
|
||||
if orgName == "" {
|
||||
path = fmt.Sprintf("repos/%s/actions/secrets/%s", ghrepo.FullName(baseRepo), opts.SecretName)
|
||||
} else {
|
||||
path = fmt.Sprintf("orgs/%s/actions/secrets/%s", opts.OrgName, opts.SecretName)
|
||||
path = fmt.Sprintf("orgs/%s/actions/secrets/%s", orgName, opts.SecretName)
|
||||
}
|
||||
|
||||
host := ghinstance.OverridableDefault()
|
||||
|
|
@ -81,7 +81,13 @@ func removeRun(opts *RemoveOptions) error {
|
|||
|
||||
if opts.IO.IsStdoutTTY() {
|
||||
cs := opts.IO.ColorScheme()
|
||||
fmt.Fprintf(opts.IO.Out, "%s Removed secret %s\n", cs.SuccessIcon(), opts.SecretName)
|
||||
if orgName == "" {
|
||||
fmt.Fprintf(opts.IO.Out,
|
||||
"%s Removed secret %s from %s\n", cs.SuccessIcon(), opts.SecretName, ghrepo.FullName(baseRepo))
|
||||
} else {
|
||||
fmt.Fprintf(opts.IO.Out,
|
||||
"%s Removed secret %s from %s\n", cs.SuccessIcon(), opts.SecretName, orgName)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -132,8 +132,8 @@ func setRun(opts *SetOptions) error {
|
|||
}
|
||||
|
||||
var pk *PubKey
|
||||
if opts.OrgName != "" {
|
||||
pk, err = getOrgPublicKey(client, opts.OrgName)
|
||||
if orgName != "" {
|
||||
pk, err = getOrgPublicKey(client, orgName)
|
||||
} else {
|
||||
pk, err = getRepoPubKey(client, baseRepo)
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ func setRun(opts *SetOptions) error {
|
|||
|
||||
encoded := base64.StdEncoding.EncodeToString(eBody)
|
||||
|
||||
if opts.OrgName != "" {
|
||||
if orgName != "" {
|
||||
err = putOrgSecret(client, pk, *opts, encoded)
|
||||
} else {
|
||||
err = putRepoSecret(client, pk, baseRepo, opts.SecretName, encoded)
|
||||
|
|
@ -159,7 +159,12 @@ func setRun(opts *SetOptions) error {
|
|||
|
||||
if opts.IO.IsStdoutTTY() {
|
||||
cs := opts.IO.ColorScheme()
|
||||
fmt.Fprintf(opts.IO.Out, "%s Set secret %s\n", cs.SuccessIcon(), opts.SecretName)
|
||||
|
||||
if orgName == "" {
|
||||
fmt.Fprintf(opts.IO.Out, "%s Set secret %s for %s\n", cs.SuccessIcon(), opts.SecretName, ghrepo.FullName(baseRepo))
|
||||
} else {
|
||||
fmt.Fprintf(opts.IO.Out, "%s Set secret %s for %s\n", cs.SuccessIcon(), opts.SecretName, orgName)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue