Skip to content

add status to the gh pr list "files" payload #11385

@dbinetti

Description

@dbinetti

Describe the feature or problem you’d like to solve

Currently it is impossible to tell whether or not files have been removed (or created, modified) from the gh pr list command; the gh api command does work for this, but does seem reasonable to add to the list output.

Proposed solution

Adding the status field to the files metadata (as returned by the gh api repos/{owner}/{repo}/pulls/{number}/files command) would be very useful for further processing.

Additional context

Example:

gh pr list --json files returns

{
    "files": [
      {
        "path": "docs/markdown.md",
        "additions": 1,
        "deletions": 1
      },
}

am proposing:

{
    "files": [
      {
        "path": "docs/markdown.md",
        "additions": 1,
        "deletions": 1,
        "status": "removed"
      },
}

Where status is { "added" | "modified" | "removed" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-prrelating to the gh pr commandhelp wantedContributions welcome

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions