Skip to content

Commit

Permalink
gh: updates from v2.53.0 (#2429)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube authored Jul 17, 2024
1 parent 9ca6b5f commit f67a59c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 32 deletions.
26 changes: 26 additions & 0 deletions completers/gh_completer/cmd/attestation_trustedRoot.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var attestation_trustedRootCmd = &cobra.Command{
Use: "trusted-root [--tuf-url <url> --tuf-root <file-path>] [--verify-only]",
Short: "Output trusted_root.jsonl contents, likely for offline verification",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(attestation_trustedRootCmd).Standalone()

attestation_trustedRootCmd.Flags().String("tuf-root", "", "Path to the TUF root.json file on disk")
attestation_trustedRootCmd.Flags().String("tuf-url", "", "URL to the TUF repository mirror")
attestation_trustedRootCmd.Flags().Bool("verify-only", false, "Don't output trusted_root.jsonl contents")
attestationCmd.AddCommand(attestation_trustedRootCmd)

carapace.Gen(attestation_trustedRootCmd).FlagCompletion(carapace.ActionMap{
"tuf-root": carapace.ActionFiles(),
// TODO tuf-url
})
}
27 changes: 0 additions & 27 deletions completers/gh_completer/cmd/attestation_tufRootVerify.go

This file was deleted.

4 changes: 2 additions & 2 deletions completers/gh_completer/cmd/attestation_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func init() {
attestation_verifyCmd.Flags().String("cert-identity", "", "Enforce that the certificate's subject alternative name matches the provided value exactly")
attestation_verifyCmd.Flags().StringP("cert-identity-regex", "i", "", "Enforce that the certificate's subject alternative name matches the provided regex")
attestation_verifyCmd.Flags().String("cert-oidc-issuer", "", "Issuer of the OIDC token")
attestation_verifyCmd.Flags().String("custom-trusted-root", "", "Path to a custom trustedroot.json file to use for verification")
attestation_verifyCmd.Flags().String("custom-trusted-root", "", "Path to a trusted_root.jsonl file; likely for offline verification")
attestation_verifyCmd.Flags().Bool("deny-self-hosted-runners", false, "Fail verification for attestations generated on self-hosted runners")
attestation_verifyCmd.Flags().StringP("digest-alg", "d", "", "The algorithm used to compute a digest of the artifact: {sha256|sha512}")
attestation_verifyCmd.Flags().String("format", "", "Output format: {json}")
attestation_verifyCmd.Flags().StringP("jq", "q", "", "Filter JSON output using a jq `expression`")
attestation_verifyCmd.Flags().StringP("limit", "L", "", "Maximum number of attestations to fetch")
attestation_verifyCmd.Flags().Bool("no-public-good", false, "Only verify attestations signed with GitHub's Sigstore instance")
attestation_verifyCmd.Flags().Bool("no-public-good", false, "Do not verify attestations signed with Sigstore public good instance")
attestation_verifyCmd.Flags().StringP("owner", "o", "", "GitHub organization to scope attestation lookup by")
attestation_verifyCmd.Flags().String("predicate-type", "", "Filter attestations by provided predicate type")
attestation_verifyCmd.Flags().StringP("repo", "R", "", "Repository name in the format <owner>/<repo>")
Expand Down
1 change: 1 addition & 0 deletions completers/gh_completer/cmd/issue_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func init() {
issue_createCmd.Flags().StringSliceP("assignee", "a", []string{}, "Assign people by their `login`. Use \"@me\" to self-assign.")
issue_createCmd.Flags().StringP("body", "b", "", "Supply a body. Will prompt for one otherwise.")
issue_createCmd.Flags().StringP("body-file", "F", "", "Read body text from `file` (use \"-\" to read from standard input)")
issue_createCmd.Flags().BoolP("editor", "e", false, "Skip prompts and open the text editor to write the title and body in. The first line is the title and the rest text is the body.")
issue_createCmd.Flags().StringSliceP("label", "l", []string{}, "Add labels by `name`")
issue_createCmd.Flags().StringP("milestone", "m", "", "Add the issue to a milestone by `name`")
issue_createCmd.Flags().StringSliceP("project", "p", []string{}, "Add the issue to projects by `name`")
Expand Down
25 changes: 25 additions & 0 deletions completers/gh_completer/cmd/pr_updateBranch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/gh_completer/cmd/action"
"github.com/spf13/cobra"
)

var pr_updateBranchCmd = &cobra.Command{
Use: "update-branch [<number> | <url> | <branch>]",
Short: "Update a pull request branch",
GroupID: "Targeted commands",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(pr_updateBranchCmd).Standalone()

pr_updateBranchCmd.Flags().Bool("rebase", false, "Update PR branch by rebasing on top of latest base branch")
prCmd.AddCommand(pr_updateBranchCmd)

carapace.Gen(pr_updateBranchCmd).PositionalCompletion(
action.ActionPullRequests(pr_updateBranchCmd, action.PullRequestOpts{Open: true}),
)
}
10 changes: 7 additions & 3 deletions completers/gh_completer/cmd/variable_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ func init() {
carapace.Gen(variable_getCmd).Standalone()

variable_getCmd.Flags().StringP("env", "e", "", "Get a variable for an environment")
variable_getCmd.Flags().StringP("jq", "q", "", "Filter JSON output using a jq `expression`")
variable_getCmd.Flags().StringSlice("json", []string{}, "Output JSON with the specified `fields`")
variable_getCmd.Flags().StringP("org", "o", "", "Get a variable for an organization")
variable_getCmd.Flags().StringP("template", "t", "", "Format JSON output using a Go template; see \"gh help formatting\"")
variableCmd.AddCommand(variable_getCmd)

carapace.Gen(variable_setCmd).FlagCompletion(carapace.ActionMap{
"env": action.ActionEnvironments(variable_setCmd),
"org": gh.ActionOrganizations(gh.HostOpts{}),
carapace.Gen(variable_getCmd).FlagCompletion(carapace.ActionMap{
"env": action.ActionEnvironments(variable_setCmd),
"json": gh.ActionVariableFields().UniqueList(","),
"org": gh.ActionOrganizations(gh.HostOpts{}),
})

carapace.Gen(variable_getCmd).PositionalCompletion(
Expand Down

0 comments on commit f67a59c

Please sign in to comment.