Skip to content

feat(pr): add changeType field to files JSON output#12657

Open
yuvrajangadsingh wants to merge 1 commit intocli:trunkfrom
yuvrajangadsingh:feature/pr-files-status
Open

feat(pr): add changeType field to files JSON output#12657
yuvrajangadsingh wants to merge 1 commit intocli:trunkfrom
yuvrajangadsingh:feature/pr-files-status

Conversation

@yuvrajangadsingh
Copy link

Adds the changeType field to the files JSON output for gh pr list and gh pr view.

This exposes the file's patch status (ADDED, MODIFIED, DELETED, RENAMED, COPIED, CHANGED) which was already available in the GraphQL API but not surfaced in the CLI output.

Before:

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

After:

{
  "files": [
    { "path": "docs/readme.md", "additions": 1, "deletions": 1, "changeType": "MODIFIED" }
  ]
}

Changes:

  • Added ChangeType field to PullRequestFile struct (api/queries_pr.go)
  • Added changeType to the GraphQL files query (api/query_builder.go)
  • Updated query builder test expectations

Closes #11385

Add the changeType field from the PullRequestChangedFile GraphQL type
to the PullRequestFile struct. This exposes the file status (added,
modified, deleted, renamed, copied, changed) in gh pr list --json files
and gh pr view --json files output.

Closes cli#11385
@yuvrajangadsingh yuvrajangadsingh marked this pull request as ready for review February 10, 2026 11:46
@yuvrajangadsingh yuvrajangadsingh requested a review from a team as a code owner February 10, 2026 11:46
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add status to the gh pr list "files" payload

2 participants