Skip to content

gh pr edit fails with Projects (classic) deprecation error even without --add-project flag #11983

@ThePlenkov

Description

@ThePlenkov

Describe the bug

gh pr edit command fails with GraphQL error about Projects (classic) deprecation, even when not using any project-related flags.

Affected version

gh version 2.45.0 (2025-07-18 Ubuntu 2.45.0-1ubuntu0.3)
https://github.com/cli/cli/releases/tag/v2.45.0

Steps to reproduce

  1. Have a repository with an existing PR
  2. Run: gh pr edit <pr_number> --body-file /tmp/release-pr.md
  3. See error

Error output

GraphQL: Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. (repository.pullRequest.projectCards)

Expected vs actual behavior

Expected: PR body should be updated successfully

Actual: Command fails with GraphQL error about Projects (classic) deprecation

Additional context

  • This appears to be a regression or incomplete fix of gh pr edit returns an error with --add-project #10681 (closed in April 2025)
  • The error occurs even when NOT using --add-project flag
  • The error suggests gh is querying projectCards field even when not needed
  • This affects automated release workflows that update PR descriptions

Workaround

None currently available - the command completely fails.

Suggested fix

The GitHub CLI should:

  1. Not query projectCards field unless explicitly needed (e.g., when using --add-project)
  2. Handle the deprecation warning gracefully instead of treating it as a fatal error
  3. Use the new Projects V2 API instead of Projects (classic)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gh-prrelating to the gh pr commandneeds-triageneeds to be reviewed

    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