Consistent with completedAt handling. Addresses Copilot review feedback
from companion PR #12807.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Prioritize --json output over --log/--follow so JSON is not silently ignored
- Emit null for zero createdAt/updatedAt values, consistent with completedAt
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rename 'status' field to 'state' for consistency with struct and UI
- Add missing JSON fields: completedAt, user, pullRequestTitle, pullRequestState
- Add test for nil PullRequest with --json
- Expand existing JSON test to cover new fields
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix empty results returning error instead of [] when --json is used
- Rename 'status' field to 'state' for consistency with struct and UI
- Add missing JSON fields: completedAt, user, pullRequestTitle, pullRequestState
- Add test for empty results with --json
- Add test for nil PullRequest with --json
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Support closing issues as duplicates via --reason duplicate and
--duplicate-of <issue> flags. The --duplicate-of flag accepts an issue
number or URL, validates it references a different issue (not a PR),
and passes the duplicate issue ID to the closeIssue mutation.
Feature detection checks whether the GHES instance supports the
DUPLICATE enum value in IssueClosedStateReason before using it.
Add --json, --jq, and --template flags to `gh agent-task view`,
consistent with the pattern used by `gh pr view --json`,
`gh issue view --json`, etc.
This reuses the same ExportData interface and SessionFields defined
for list, applying them to the single-session view output.
Closes https://github.com/cli/cli/issues/12805 (partial)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add --json, --jq, and --template flags to `gh agent-task list`,
consistent with the pattern used by `gh pr list --json`,
`gh issue list --json`, etc.
This implements the ExportData interface on capi.Session and defines
SessionFields for the available JSON fields:
id, name, status, repository, createdAt, updatedAt,
pullRequestNumber, pullRequestUrl.
Closes https://github.com/cli/cli/issues/12805 (partial)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace `1;38` with `1;37` (bold white) in the delimiter/header
color constant. SGR parameter 38 is the extended foreground color
prefix and requires sub-parameters (e.g. `38;5;n` or `38;2;r;g;b`),
so using it bare produces an invalid escape sequence. Most terminals
silently ignore the malformed parameter, masking the bug.
Fixescli/cli#12683
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the help text and flag description for `gh release upload --clobber`
to make it clear that existing assets are deleted before new ones are uploaded,
and that original assets will be lost if the upload fails.
Fixes#8822
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a cobra Example string to the gist edit command showing common
operations: interactive selection, editing in default editor, editing a
specific file, replacing file content, adding/removing files, and
changing the description.
Closes#8943
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add greppable TODO identifiers above all if-statements that reference
featuredetection struct fields, as required by the featuredetection
linter. This ensures every feature detection branch is tagged for
future cleanup when GHES gains support.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When cloning a forked repository, `gh repo clone` automatically adds the
parent repo as an `upstream` remote and sets it as the default repository.
This can be problematic when the user lacks access to the parent repo,
the upstream fetch is expensive for large repos, or the user simply
doesn't want the upstream remote.
Add a `--no-upstream` flag that skips adding the upstream remote when
cloning a fork. When used, origin (the fork) is set as the default
repository instead. The flag is mutually exclusive with
`--upstream-remote-name`. For non-fork repos the flag is a harmless
no-op.
Closes#8274