Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/queries_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func IssueStatus(client *Client, repo ghrepo.Interface, options IssueStatusOptio
}
}
}
}`
}`

variables := map[string]interface{}{
"owner": repo.RepoOwner(),
Expand Down
8 changes: 4 additions & 4 deletions api/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ func StatusCheckRollupGraphQLWithCountByState() string {
contexts {
checkRunCount,
checkRunCountsByState {
state,
count
state,
count
},
statusContextCount,
statusContextCountsByState {
state,
count
state,
count
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/attestation/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewCmdAttestation(f *cmdutil.Factory) *cobra.Command {
Aliases: []string{"at"},
Long: heredoc.Doc(`
Download and verify artifact attestations.
`),
`),
}

root.AddCommand(download.NewDownloadCmd(f, nil))
Expand Down
24 changes: 12 additions & 12 deletions pkg/cmd/attestation/trustedroot/trustedroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ func NewTrustedRootCmd(f *cmdutil.Factory, runF func(*Options) error) *cobra.Com
Long: heredoc.Docf(`
### NOTE: This feature is currently in beta, and subject to change.

Output contents for a trusted_root.jsonl file, likely for offline verification.
Output contents for a trusted_root.jsonl file, likely for offline verification.

When using %[1]sgh attestation verify%[1]s, if your machine is on the internet,
this will happen automatically. But to do offline verification, you need to
supply a trusted root file with %[1]s--custom-trusted-root%[1]s; this command
will help you fetch a %[1]strusted_root.jsonl%[1]s file for that purpose.
When using %[1]sgh attestation verify%[1]s, if your machine is on the internet,
this will happen automatically. But to do offline verification, you need to
supply a trusted root file with %[1]s--custom-trusted-root%[1]s; this command
will help you fetch a %[1]strusted_root.jsonl%[1]s file for that purpose.

You can call this command without any flags to get a trusted root file covering
the Sigstore Public Good Instance as well as GitHub's Sigstore instance.
You can call this command without any flags to get a trusted root file covering
the Sigstore Public Good Instance as well as GitHub's Sigstore instance.

Otherwise you can use %[1]s--tuf-url%[1]s to specify the URL of a custom TUF
repository mirror, and %[1]s--tuf-root%[1]s should be the path to the
%[1]sroot.json%[1]s file that you securely obtained out-of-band.
Otherwise you can use %[1]s--tuf-url%[1]s to specify the URL of a custom TUF
repository mirror, and %[1]s--tuf-root%[1]s should be the path to the
%[1]sroot.json%[1]s file that you securely obtained out-of-band.

If you just want to verify the integrity of your local TUF repository, and don't
want the contents of a trusted_root.jsonl file, use %[1]s--verify-only%[1]s.
If you just want to verify the integrity of your local TUF repository, and don't
want the contents of a trusted_root.jsonl file, use %[1]s--verify-only%[1]s.
Comment on lines 33 to +50
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparison of latest release versus changes:

andyfeller@Andys-MBP:cli/cli β€Ήtab-indentsβ€Ί$ gh attestation trusted-root --help
### NOTE: This feature is currently in beta, and subject to change.

         Output contents for a trusted_root.jsonl file, likely for offline verification.

         When using `gh attestation verify`, if your machine is on the internet,
         this will happen automatically. But to do offline verification, you need to
         supply a trusted root file with `--custom-trusted-root`; this command
         will help you fetch a `trusted_root.jsonl` file for that purpose.

         You can call this command without any flags to get a trusted root file covering
         the Sigstore Public Good Instance as well as GitHub's Sigstore instance.

         Otherwise you can use `--tuf-url` to specify the URL of a custom TUF
         repository mirror, and `--tuf-root` should be the path to the
         `root.json` file that you securely obtained out-of-band.

         If you just want to verify the integrity of your local TUF repository, and don't
         want the contents of a trusted_root.jsonl file, use `--verify-only`.


USAGE
  gh attestation trusted-root [--tuf-url <url> --tuf-root <file-path>] [--verify-only] [flags]

FLAGS
  --tuf-root string   Path to the TUF root.json file on disk
  --tuf-url string    URL to the TUF repository mirror
  --verify-only       Don't output trusted_root.jsonl contents

INHERITED FLAGS
  --help   Show help for command

EXAMPLES
  # Get a trusted_root.jsonl for both Sigstore Public Good and GitHub's instance
  gh attestation trusted-root

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

andyfeller@Andys-MBP:cli/cli β€Ήtab-indentsβ€Ί$ ./bin/gh attestation trusted-root --help
### NOTE: This feature is currently in beta, and subject to change.

Output contents for a trusted_root.jsonl file, likely for offline verification.

When using `gh attestation verify`, if your machine is on the internet,
this will happen automatically. But to do offline verification, you need to
supply a trusted root file with `--custom-trusted-root`; this command
will help you fetch a `trusted_root.jsonl` file for that purpose.

You can call this command without any flags to get a trusted root file covering
the Sigstore Public Good Instance as well as GitHub's Sigstore instance.

Otherwise you can use `--tuf-url` to specify the URL of a custom TUF
repository mirror, and `--tuf-root` should be the path to the
`root.json` file that you securely obtained out-of-band.

If you just want to verify the integrity of your local TUF repository, and don't
want the contents of a trusted_root.jsonl file, use `--verify-only`.


USAGE
  gh attestation trusted-root [--tuf-url <url> --tuf-root <file-path>] [--verify-only] [flags]

FLAGS
  --tuf-root string   Path to the TUF root.json file on disk
  --tuf-url string    URL to the TUF repository mirror
  --verify-only       Don't output trusted_root.jsonl contents

INHERITED FLAGS
  --help   Show help for command

EXAMPLES
  # Get a trusted_root.jsonl for both Sigstore Public Good and GitHub's instance
  gh attestation trusted-root

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

Big improvement πŸ‘

`, "`"),
Example: heredoc.Doc(`
# Get a trusted_root.jsonl for both Sigstore Public Good and GitHub's instance
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/codespace/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func newSSHCmd(app *App) *cobra.Command {
The %[1]sssh%[1]s command will automatically create a public/private ssh key pair in the
%[1]s~/.ssh%[1]s directory if you do not have an existing valid key pair. When selecting the
key pair to use, the preferred order is:

1. Key specified by %[1]s-i%[1]s in %[1]s<ssh-flags>%[1]s
2. Automatic key, if it already exists
3. First valid key pair in ssh config (according to %[1]sssh -G%[1]s)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/pr/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman

Find a PR that introduced a given commit
$ gh pr list --search "<SHA>" --state merged
`),
`),
Aliases: []string{"ls"},
Args: cmdutil.NoArgsQuoteReminder,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/pr/merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewCmdMerge(f *cmdutil.Factory, runF func(*MergeOptions) error) *cobra.Comm
If required checks have not yet passed, auto-merge will be enabled.
If required checks have passed, the pull request will be added to the merge queue.
To bypass a merge queue and merge directly, pass the %[1]s--admin%[1]s flag.
`, "`"),
`, "`"),
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.Finder = shared.NewFinder(f)
Expand Down
34 changes: 17 additions & 17 deletions pkg/cmd/pr/status/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,23 @@ func pullRequestStatus(httpClient *http.Client, repo ghrepo.Interface, options r
}

query := fragments + queryPrefix + `
viewerCreated: search(query: $viewerQuery, type: ISSUE, first: $per_page) {
totalCount: issueCount
edges {
node {
...prWithReviews
}
}
}
reviewRequested: search(query: $reviewerQuery, type: ISSUE, first: $per_page) {
totalCount: issueCount
edges {
node {
...pr
}
}
}
}
viewerCreated: search(query: $viewerQuery, type: ISSUE, first: $per_page) {
totalCount: issueCount
edges {
node {
...prWithReviews
}
}
}
reviewRequested: search(query: $reviewerQuery, type: ISSUE, first: $per_page) {
totalCount: issueCount
edges {
node {
...pr
}
}
}
}
`

currentUsername := options.Username
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/release/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co

Use release notes from a file
$ gh release create v1.2.3 -F changelog.md

Don't mark the release as latest
$ gh release create v1.2.3 --latest=false

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/repo/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
To create a remote repository non-interactively, supply the repository name and one of %[1]s--public%[1]s, %[1]s--private%[1]s, or %[1]s--internal%[1]s.
Pass %[1]s--clone%[1]s to clone the new repository locally.

If the %[1]sOWNER/%[1]s portion of the %[1]sOWNER/REPO%[1]s name argument is omitted, it
If the %[1]sOWNER/%[1]s portion of the %[1]sOWNER/REPO%[1]s name argument is omitted, it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

andyfeller@Andys-MBP:cli/cli β€Ήtab-indentsβ€Ί$ gh repo create --help
Create a new GitHub repository.

To create a repository interactively, use `gh repo create` with no arguments.

To create a remote repository non-interactively, supply the repository name and one of `--public`, `--private`, or `--internal`.
Pass `--clone` to clone the new repository locally.

                     If the `OWNER/` portion of the `OWNER/REPO` name argument is omitted, it
defaults to the name of the authenticating user.

To create a remote repository from an existing local repository, specify the source directory with `--source`.
By default, the remote repository name will be the name of the source directory.
Pass `--push` to push any local commits to the new repository.


USAGE
  gh repo create [<name>] [flags]

ALIASES
  gh repo new

FLAGS
      --add-readme             Add a README file to the new repository
  -c, --clone                  Clone the new repository to the current directory
  -d, --description string     Description of the repository
      --disable-issues         Disable issues in the new repository
      --disable-wiki           Disable wiki in the new repository
  -g, --gitignore string       Specify a gitignore template for the repository
  -h, --homepage URL           Repository home page URL
      --include-all-branches   Include all branches from template repository
      --internal               Make the new repository internal
  -l, --license string         Specify an Open Source License for the repository
      --private                Make the new repository private
      --public                 Make the new repository public
      --push                   Push local commits to the new repository
  -r, --remote string          Specify remote name for the new repository
  -s, --source string          Specify path to local repository to use as source
  -t, --team name              The name of the organization team to be granted access
  -p, --template repository    Make the new repository based on a template repository

INHERITED FLAGS
  --help   Show help for command

EXAMPLES
  # create a repository interactively
  gh repo create
  
  # create a new remote repository and clone it locally
  gh repo create my-project --public --clone
  
  # create a new remote repository in a different organization
  gh repo create my-org/my-project --public
  
  # create a remote repository from the current directory
  gh repo create my-project --private --source=. --remote=upstream

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

andyfeller@Andys-MBP:cli/cli β€Ήtab-indentsβ€Ί$ ./bin/gh repo create --help
Create a new GitHub repository.

To create a repository interactively, use `gh repo create` with no arguments.

To create a remote repository non-interactively, supply the repository name and one of `--public`, `--private`, or `--internal`.
Pass `--clone` to clone the new repository locally.

If the `OWNER/` portion of the `OWNER/REPO` name argument is omitted, it
defaults to the name of the authenticating user.

To create a remote repository from an existing local repository, specify the source directory with `--source`.
By default, the remote repository name will be the name of the source directory.
Pass `--push` to push any local commits to the new repository.


USAGE
  gh repo create [<name>] [flags]

ALIASES
  gh repo new

FLAGS
      --add-readme             Add a README file to the new repository
  -c, --clone                  Clone the new repository to the current directory
  -d, --description string     Description of the repository
      --disable-issues         Disable issues in the new repository
      --disable-wiki           Disable wiki in the new repository
  -g, --gitignore string       Specify a gitignore template for the repository
  -h, --homepage URL           Repository home page URL
      --include-all-branches   Include all branches from template repository
      --internal               Make the new repository internal
  -l, --license string         Specify an Open Source License for the repository
      --private                Make the new repository private
      --public                 Make the new repository public
      --push                   Push local commits to the new repository
  -r, --remote string          Specify remote name for the new repository
  -s, --source string          Specify path to local repository to use as source
  -t, --team name              The name of the organization team to be granted access
  -p, --template repository    Make the new repository based on a template repository

INHERITED FLAGS
  --help   Show help for command

EXAMPLES
  # create a repository interactively
  gh repo create
  
  # create a new remote repository and clone it locally
  gh repo create my-project --public --clone
  
  # create a new remote repository in a different organization
  gh repo create my-org/my-project --public
  
  # create a remote repository from the current directory
  gh repo create my-project --private --source=. --remote=upstream

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual

defaults to the name of the authenticating user.

To create a remote repository from an existing local repository, specify the source directory with %[1]s--source%[1]s.
Expand Down
18 changes: 9 additions & 9 deletions pkg/cmd/repo/credits/credits.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ func NewCmdRepoCredits(f *cmdutil.Factory, runF func(*CreditsOptions) error) *co
Use: "credits [<repository>]",
Short: "View credits for a repository",
Example: heredoc.Doc(`
# view credits for the current repository
$ gh repo credits
# view credits for the current repository
$ gh repo credits

# view credits for a specific repository
$ gh repo credits cool/repo
# view credits for a specific repository
$ gh repo credits cool/repo

# print a non-animated thank you
$ gh repo credits -s
# print a non-animated thank you
$ gh repo credits -s

# pipe to just print the contributors, one per line
$ gh repo credits | cat
`),
# pipe to just print the contributors, one per line
$ gh repo credits | cat
`),
Comment on lines 81 to +93
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘ change, no impact on rendering but improves code formatting

Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) > 0 {
Expand Down
79 changes: 39 additions & 40 deletions pkg/cmd/root/help_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,25 @@ var HelpTopics = []helpTopic{
$ gh pr list --json number,title,author
[
{
"author": {
"login": "monalisa"
},
"number": 123,
"title": "A helpful contribution"
"author": {
"login": "monalisa"
},
"number": 123,
"title": "A helpful contribution"
},
{
"author": {
"login": "codercat"
},
"number": 124,
"title": "Improve the docs"
"author": {
"login": "codercat"
},
"number": 124,
"title": "Improve the docs"
},
{
"author": {
"login": "cli-maintainer"
},
"number": 125,
"title": "An exciting new feature"
"author": {
"login": "cli-maintainer"
},
"number": 125,
"title": "An exciting new feature"
}
]

Expand All @@ -193,32 +193,31 @@ var HelpTopics = []helpTopic{
| map(.labels = (.labels | map(.name))) # show only the label names
| .[:3] # select the first 3 results'
[
{
"labels": [
"enhancement",
"needs triage"
],
"number": 123,
"title": "A helpful contribution"
},
{
"labels": [
"help wanted",
"docs",
"good first issue"
],
"number": 125,
"title": "Improve the docs"
},
{
"labels": [
"enhancement",
],
"number": 7221,
"title": "An exciting new feature"
}
{
"labels": [
"enhancement",
"needs triage"
],
"number": 123,
"title": "A helpful contribution"
},
{
"labels": [
"help wanted",
"docs",
"good first issue"
],
"number": 125,
"title": "Improve the docs"
},
{
"labels": [
"enhancement",
],
"number": 7221,
"title": "An exciting new feature"
}
]

# using the --template flag with the hyperlink helper
gh issue list --json title,url --template '{{range .}}{{hyperlink .url .title}}{{"\n"}}{{end}}'

Expand Down
16 changes: 8 additions & 8 deletions pkg/cmd/run/download/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ func NewCmdDownload(f *cmdutil.Factory, runF func(*DownloadOptions) error) *cobr
`),
Args: cobra.MaximumNArgs(1),
Example: heredoc.Doc(`
# Download all artifacts generated by a workflow run
$ gh run download <run-id>
# Download all artifacts generated by a workflow run
$ gh run download <run-id>

# Download a specific artifact within a run
$ gh run download <run-id> -n <name>
# Download a specific artifact within a run
$ gh run download <run-id> -n <name>

# Download specific artifacts across all runs in a repository
$ gh run download -n <name1> -n <name2>
# Download specific artifacts across all runs in a repository
$ gh run download -n <name1> -n <name2>

# Select artifacts to download interactively
$ gh run download
# Select artifacts to download interactively
$ gh run download
Comment on lines +54 to +64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘ better code formatting, no impact on --help output

`),
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/run/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
Use: "list",
Short: "List recent workflow runs",
Long: heredoc.Docf(`
List recent workflow runs.
List recent workflow runs.

Note that providing the %[1]sworkflow_name%[1]s to the %[1]s-w%[1]s flag will not fetch disabled workflows.
Also pass the %[1]s-a%[1]s flag to fetch disabled workflow runs using the %[1]sworkflow_name%[1]s and the %[1]s-w%[1]s flag.
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/search/commits/commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewCmdCommits(f *cmdutil.Factory, runF func(*CommitsOptions) error) *cobra.

GitHub search syntax is documented at:
<https://docs.github.com/search-github/searching-on-github/searching-commits>
`),
`),
Example: heredoc.Doc(`
# search commits matching set of keywords "readme" and "typo"
$ gh search commits readme typo
Expand All @@ -64,7 +64,7 @@ func NewCmdCommits(f *cmdutil.Factory, runF func(*CommitsOptions) error) *cobra.

# search commits authored before February 1st, 2022
$ gh search commits --author-date="<2022-02-01"
`),
`),
RunE: func(c *cobra.Command, args []string) error {
if len(args) == 0 && c.Flags().NFlag() == 0 {
return cmdutil.FlagErrorf("specify search keywords or flags")
Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/search/issues/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c

GitHub search syntax is documented at:
<https://docs.github.com/search-github/searching-on-github/searching-issues-and-pull-requests>
`),
`),
Example: heredoc.Doc(`
# search issues matching set of keywords "readme" and "typo"
$ gh search issues readme typo
Expand All @@ -56,8 +56,7 @@ func NewCmdIssues(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *c

# search issues only from un-archived repositories (default is all repositories)
$ gh search issues --owner github --archived=false

`),
`),
RunE: func(c *cobra.Command, args []string) error {
if len(args) == 0 && c.Flags().NFlag() == 0 {
return cmdutil.FlagErrorf("specify search keywords or flags")
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/search/prs/prs.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewCmdPrs(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *cobr

GitHub search syntax is documented at:
<https://docs.github.com/search-github/searching-on-github/searching-issues-and-pull-requests>
`),
`),
Example: heredoc.Doc(`
# search pull requests matching set of keywords "fix" and "bug"
$ gh search prs fix bug
Expand All @@ -58,7 +58,7 @@ func NewCmdPrs(f *cmdutil.Factory, runF func(*shared.IssuesOptions) error) *cobr

# search pull requests only from un-archived repositories (default is all repositories)
$ gh search prs --owner github --archived=false
`),
`),
RunE: func(c *cobra.Command, args []string) error {
if len(args) == 0 && c.Flags().NFlag() == 0 {
return cmdutil.FlagErrorf("specify search keywords or flags")
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/search/repos/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewCmdRepos(f *cmdutil.Factory, runF func(*ReposOptions) error) *cobra.Comm

GitHub search syntax is documented at:
<https://docs.github.com/search-github/searching-on-github/searching-for-repositories>
`),
`),
Example: heredoc.Doc(`
# search repositories matching set of keywords "cli" and "shell"
$ gh search repos cli shell
Expand All @@ -68,7 +68,7 @@ func NewCmdRepos(f *cmdutil.Factory, runF func(*ReposOptions) error) *cobra.Comm

# search repositories excluding archived repositories
$ gh search repos --archived=false
`),
`),
RunE: func(c *cobra.Command, args []string) error {
if len(args) == 0 && c.Flags().NFlag() == 0 {
return cmdutil.FlagErrorf("specify search keywords or flags")
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/variable/variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func NewCmdVariable(f *cmdutil.Factory) *cobra.Command {
Long: heredoc.Docf(`
Variables can be set at the repository, environment or organization level for use in
GitHub Actions or Dependabot. Run %[1]sgh help variable set%[1]s to learn how to get started.
`, "`"),
`, "`"),
}

cmdutil.EnableRepoOverride(cmd, f)
Expand Down
Loading