"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/cmd/secret/set/set.go" between
gh-cli-1.11.0.tar.gz and gh-cli-1.12.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

set.go  (gh-cli-1.11.0):set.go  (gh-cli-1.12.0)
skipping to change at line 127 skipping to change at line 127
} }
if runF != nil { if runF != nil {
return runF(opts) return runF(opts)
} }
return setRun(opts) return setRun(opts)
}, },
} }
cmd.Flags().StringVarP(&opts.OrgName, "org", "o", "", "Set a secret for a n organization") cmd.Flags().StringVarP(&opts.OrgName, "org", "o", "", "Set a secret for a n organization")
cmd.Flags().StringVarP(&opts.EnvName, "env", "e", "", "Set a secret for a n organization") cmd.Flags().StringVarP(&opts.EnvName, "env", "e", "", "Set a secret for a n environment")
cmd.Flags().StringVarP(&opts.Visibility, "visibility", "v", "private", "S et visibility for an organization secret: `all`, `private`, or `selected`") cmd.Flags().StringVarP(&opts.Visibility, "visibility", "v", "private", "S et visibility for an organization secret: `all`, `private`, or `selected`")
cmd.Flags().StringSliceVarP(&opts.RepositoryNames, "repos", "r", []string {}, "List of repository names for `selected` visibility") cmd.Flags().StringSliceVarP(&opts.RepositoryNames, "repos", "r", []string {}, "List of repository names for `selected` visibility")
cmd.Flags().StringVarP(&opts.Body, "body", "b", "", "A value for the secr et. Reads from STDIN if not specified.") cmd.Flags().StringVarP(&opts.Body, "body", "b", "", "A value for the secr et. Reads from STDIN if not specified.")
return cmd return cmd
} }
func setRun(opts *SetOptions) error { func setRun(opts *SetOptions) error {
body, err := getBody(opts) body, err := getBody(opts)
if err != nil { if err != nil {
skipping to change at line 171 skipping to change at line 171
} }
host, err := cfg.DefaultHost() host, err := cfg.DefaultHost()
if err != nil { if err != nil {
return err return err
} }
var pk *PubKey var pk *PubKey
if orgName != "" { if orgName != "" {
pk, err = getOrgPublicKey(client, host, orgName) pk, err = getOrgPublicKey(client, host, orgName)
} else if envName != "" {
pk, err = getEnvPubKey(client, baseRepo, envName)
} else { } else {
pk, err = getRepoPubKey(client, baseRepo) pk, err = getRepoPubKey(client, baseRepo)
} }
if err != nil { if err != nil {
return fmt.Errorf("failed to fetch public key: %w", err) return fmt.Errorf("failed to fetch public key: %w", err)
} }
eBody, err := box.SealAnonymous(nil, body, &pk.Raw, opts.RandomOverride) eBody, err := box.SealAnonymous(nil, body, &pk.Raw, opts.RandomOverride)
if err != nil { if err != nil {
return fmt.Errorf("failed to encrypt body: %w", err) return fmt.Errorf("failed to encrypt body: %w", err)
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)