Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add --edit-last-or-create option or enhance the functionality of --edit-last for PR comments #6790

Copy link
Copy link

Description

@joe-sharp
Issue body actions

Describe the feature or problem you’d like to solve

Currently running gh pr comment --edit-last will fail if there is not an existing comment from the author. It would be nice to prompt users and/or allow users to use the option (or a new option) that will edit the last comment if it it exists but creates a new one if not.

❯ gh pr comment 5 --edit-last --body 'This is just a test'
no comments found for current user

Proposed solution

Add an additional option for gh pr comment such as --edit-last-or-create that will not fail if the user hasn't yet commented on the PR, it will simply create a new comment.

❯ gh pr comment 5 --edit-last-or-create --body 'This is just a test'
https://github.com/joe-sharp/<redacted>/pull/5#issuecomment-<redacted>

How will it benefit CLI and its users?
Script writers will no longer need to worry about making a conditional to check if a comment exists before running the command. This is useful for commenting the results of a build or linting job without polluting the PR with multiple comments.

Additional context

Please let me know if additional context is needed, but this should be pretty straight forward.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIa request to improve CLIgh-prrelating to the gh pr commandrelating to the gh pr command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.