Skip to content

Use int64 for GitHub database IDs#13403

Merged
BagToad merged 5 commits into
trunkfrom
9247-ensure-the-cli-handles-github-database-ids-correctly
Jun 19, 2026
Merged

Use int64 for GitHub database IDs#13403
BagToad merged 5 commits into
trunkfrom
9247-ensure-the-cli-handles-github-database-ids-correctly

Conversation

@williammartin

@williammartin williammartin commented May 12, 2026

Copy link
Copy Markdown
Member

Use int64 for GitHub database IDs

Closes #9247

Problem

Several structs in the CLI use Go's int type for GitHub database ID fields. Go's int is platform-dependent and could be 32-bit on some architectures, while GitHub internally uses 64-bit integers for database IDs. The REST API OpenAPI spec explicitly declares many resource IDs as integer with format: int64 (e.g. repositories, GPG keys, SSH keys), and the GraphQL API has migrated some databaseId fields from Int to BigInt.

Changes

Updated all struct fields representing GitHub database IDs from int to int64, along with their downstream usage:

  • Codespaces: Repository.ID, CreateCodespaceParams.RepositoryID, startCreateRequest.RepositoryID, plus interface/mock/test cascading
  • Rulesets: RulesetGraphQL.DatabaseId, RulesetREST.Id, BypassActors.ActorId, RulesetRule.RulesetId, and the skills rulesetsResponse.ID
  • Keys: deployKey.ID, gpgKey.ID, sshKey.ID
  • Cache: Cache.Id, plus parseCacheID and deleteCacheByID (which still used int/strconv.Atoi)
  • Autolinks: Autolink.ID
  • Agent tasks: JobActor.ID, JobPullRequest.ID

All strconv.Itoa() calls on these fields were updated to strconv.FormatInt(x, 10).

GraphQL response structs were also audited - only RulesetGraphQL.DatabaseId needed updating. Others were already correct (GitHubUser.DatabaseID is int64, FullDatabaseID is string for GraphQL BigInt).

Future: Custom linter to prevent regressions

A custom go/analysis linter that flags struct fields with ID-like names or JSON tags still using int has been prototyped on a separate branch: 9247-idtype-linter. It's split out to keep this PR focused on the type changes. The linter correctly identifies all the violations fixed here.

Linter output BEFORE this PR (27 violations)
pkg/cmd/agent-task/capi/job.go:38:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/agent-task/capi/job.go:43:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/ssh-key/shared/user_keys.go:20:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/cache/shared/shared.go:25:2: struct field Id looks like a GitHub database ID but uses int; use int64 instead
internal/codespaces/api/api.go:153:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
internal/codespaces/api/api.go:807:2: struct field RepositoryID looks like a GitHub database ID but uses int; use int64 instead
internal/codespaces/api/api.go:858:2: struct field RepositoryID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:203:4: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:216:4: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:260:4: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:591:3: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:614:2: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:621:3: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:639:3: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:660:2: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:666:3: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:858:3: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:879:2: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/codespace/mock_api.go:885:3: struct field RepoID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/gpg-key/delete/http.go:14:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/repo/autolink/shared/autolink.go:6:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/repo/deploy-key/list/http.go:16:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/ruleset/shared/shared.go:13:2: struct field DatabaseId looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/ruleset/shared/shared.go:27:2: struct field Id looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/ruleset/shared/shared.go:33:3: struct field ActorId looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/ruleset/shared/shared.go:53:2: struct field RulesetId looks like a GitHub database ID but uses int; use int64 instead
pkg/cmd/skills/publish/publish.go:67:2: struct field ID looks like a GitHub database ID but uses int; use int64 instead
Linter output AFTER this PR (0 violations)
(clean - no output)

Reviewer Notes

We should run A/C tests on this before merging.

@williammartin williammartin linked an issue May 12, 2026 that may be closed by this pull request
williammartin and others added 2 commits May 13, 2026 13:16
Change all struct fields representing GitHub database IDs from int to
int64 to match the API spec and prevent potential overflow on 32-bit
architectures.

Add a custom go/analysis linter (idtype-checker) that flags struct
fields with ID-like names or JSON tags using int instead of int64,
integrated into make lint.

Closes #9247

Co-authored-by: Copilot <[email protected]>
The idtype linter directly imports golang.org/x/tools/go/analysis, so
go mod tidy correctly moves it from indirect to direct.

Co-authored-by: Copilot <[email protected]>
@williammartin
williammartin force-pushed the 9247-ensure-the-cli-handles-github-database-ids-correctly branch from 4a447a9 to d120828 Compare May 13, 2026 11:18
@williammartin
williammartin requested a review from Copilot May 13, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes GitHub database ID handling by migrating relevant struct fields from Go’s platform-dependent int to int64, and adds a custom go/analysis linter to prevent regressions.

Changes:

  • Updated multiple REST/GraphQL response/request structs to use int64 for GitHub database IDs (and adjusted downstream usages).
  • Replaced strconv.Itoa with strconv.FormatInt(..., 10) where IDs are stringified.
  • Added an idtype analyzer + idtype-checker command, and wired it into make lint.
Show a summary per file
File Description
pkg/linter/idtype/testdata/src/example/example.go Analyzer test fixture covering flagged and non-flagged ID patterns.
pkg/linter/idtype/analyzer.go New go/analysis analyzer that reports int-typed ID-like struct fields.
pkg/linter/idtype/analyzer_test.go Runs the analyzer against analysistest testdata.
cmd/idtype-checker/main.go singlechecker entrypoint for running the analyzer in lint.
Makefile Adds idtype-checker execution to the lint target.
go.mod Promotes golang.org/x/tools to a direct dependency for the analyzer tooling.
pkg/cmd/ssh-key/shared/user_keys.go Switches SSH key ID field to int64.
pkg/cmd/ssh-key/list/list.go Uses FormatInt for SSH key ID display.
pkg/cmd/skills/publish/publish.go Switches rulesets API response ID field to int64.
pkg/cmd/ruleset/shared/shared.go Switches ruleset-related ID fields (GraphQL/REST) to int64.
pkg/cmd/ruleset/list/list.go Uses FormatInt for ruleset ID display.
pkg/cmd/ruleset/view/view.go Uses FormatInt for ruleset IDs (both selected and displayed).
pkg/cmd/repo/deploy-key/list/http.go Switches deploy key ID field to int64.
pkg/cmd/repo/deploy-key/list/list.go Uses FormatInt for deploy key ID display.
pkg/cmd/repo/autolink/shared/autolink.go Switches autolink ID field to int64.
pkg/cmd/gpg-key/delete/http.go Switches GPG key ID field to int64.
pkg/cmd/gpg-key/delete/delete.go Uses FormatInt for selected GPG key ID.
pkg/cmd/cache/shared/shared.go Switches cache ID field to int64.
pkg/cmd/cache/delete/delete.go Uses FormatInt when collecting cache IDs to delete.
pkg/cmd/agent-task/capi/job.go Switches agent-task actor/PR ID fields to int64.
internal/codespaces/api/api.go Switches codespaces repository/request IDs and related method params to int64.
pkg/cmd/codespace/common.go Updates codespaces API client interface method signatures to use int64 repo IDs.
pkg/cmd/codespace/create.go Updates helper signature to accept int64 repo IDs.
pkg/cmd/codespace/create_test.go Updates mock signatures to match int64 repo ID APIs.
pkg/cmd/codespace/mock_api.go Updates generated mock types/signatures and call capture fields to int64.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Files not reviewed (1)
  • pkg/cmd/codespace/mock_api.go: Language not supported
  • Files reviewed: 24/25 changed files
  • Comments generated: 1

Comment thread pkg/linter/idtype/analyzer.go Outdated
williammartin and others added 3 commits May 13, 2026 17:31
Replace manual string manipulation with strconv.Unquote and
reflect.StructTag.Lookup to correctly parse both raw (backtick) and
interpreted (double-quoted) struct tag literals. The previous
implementation silently missed ID fields when tags used interpreted
string literals with escape sequences.

Add test cases with interpreted string literal tags using non-ID field
names to isolate coverage of the JSON tag parsing path.

Co-authored-by: Copilot <[email protected]>
The idtype linter has been moved to the 9247-idtype-linter branch
for separate review.

Co-authored-by: Copilot <[email protected]>
These functions still used int/strconv.Atoi, which would silently
truncate cache IDs larger than 2^31-1 on 32-bit systems.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

Files not reviewed (1)
  • pkg/cmd/codespace/mock_api.go: Language not supported
  • Files reviewed: 18/19 changed files
  • Comments generated: 0 new

@williammartin
williammartin marked this pull request as ready for review May 13, 2026 16:22
@williammartin
williammartin requested review from a team as code owners May 13, 2026 16:22
@williammartin
williammartin requested a review from BagToad May 13, 2026 16:23

@SamMorrowDrums SamMorrowDrums left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving skills part, and 100% agree generally

@BagToad

BagToad commented Jun 19, 2026

Copy link
Copy Markdown
Member

Ran the acceptance suites relevant to these changes. The only failures were pre-existing and environmental - a hardcoded deploy-key fixture that's globally claimed, and a 409 during repo cleanup (the archive/unarchive assertions themselves passed). Nothing is caused by the int64 change.

@BagToad BagToad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean int -> int64 migration for GitHub database IDs. LGTM.

@BagToad
BagToad merged commit 0274077 into trunk Jun 19, 2026
43 checks passed
@BagToad
BagToad deleted the 9247-ensure-the-cli-handles-github-database-ids-correctly branch June 19, 2026 21:40
davidlovas added a commit to rexovasgroup/ghx that referenced this pull request Jun 22, 2026
Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
davidlovas added a commit to rexovasgroup/ghx that referenced this pull request Jun 22, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
davidlovas added a commit to rexovasgroup/ghx that referenced this pull request Jun 22, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jun 22, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 2, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 3, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 3, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 3, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 3, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 8, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 8, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 9, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://github.com/cli/cli) | minor | `v2.94.0` → `v2.96.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.96.0`](https://github.com/cli/cli/releases/tag/v2.96.0): GitHub CLI 2.96.0

[Compare Source](cli/cli@v2.95.0...v2.96.0)

#### Security

A security vulnerability has been identified, and fixed, that could allow command execution on a user's computer when connecting to a malicious Codespace via `gh codespace jupyter`.

Users of `gh codespace jupyter` are advised to update gh to version v2.96.0 as soon as possible.

For more information see: <GHSA-8cg3-r6g9-fpg2>

#### Download release assets without authentication

`gh release download` now works against public repositories without authentication, matching `gh extension install`. A token is still used when one is present:

```shell

# Download assets from a public repository, no login required
gh release download v2.96.0 --repo cli/cli
```

#### What's Changed

##### ✨ Features

- Allow `gh release download` without authentication on public repositories by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;13723](cli/cli#13723)
- Detect additional third-party coding agents by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;13722](cli/cli#13722)
- Support `antigravity-cli` and `antigravity2.0` in `gh skill` by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;13784](cli/cli#13784)

##### 🐛 Fixes

- fix: show checks summary when all checks were cancelled by [@&#8203;s3onghyun](https://github.com/s3onghyun) in [#&#8203;13679](cli/cli#13679)
- fix(skills): install universal agent to `~/.agents/skills` by [@&#8203;toller892](https://github.com/toller892) in [#&#8203;13681](cli/cli#13681)
- fix(skills): honor `--dir` without agent prompt by [@&#8203;happysnaker](https://github.com/happysnaker) in [#&#8203;13766](cli/cli#13766)
- Fix concurrent map writes in codespace port forwarding by [@&#8203;williammartin](https://github.com/williammartin) in [#&#8203;13313](cli/cli#13313)
- Use `int64` for GitHub database IDs by [@&#8203;williammartin](https://github.com/williammartin) in [#&#8203;13403](cli/cli#13403)

##### 📚 Docs & Chores

- Pin reusable triage workflows to a commit SHA by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;13705](cli/cli#13705)
- Add security disclosure guidance to `AGENTS.md` by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;13720](cli/cli#13720)
- Clarify `--clone` boolean flag behaviour in `gh repo fork` help by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;13786](cli/cli#13786)
- Fix flaky `TestHuhPrompterMultiSelectWithSearchPersistence` on slow architectures by [@&#8203;pdostal](https://github.com/pdostal) in [#&#8203;13675](cli/cli#13675)
- docs(search): add examples for multiple qualifiers by [@&#8203;happysnaker](https://github.com/happysnaker) in [#&#8203;13756](cli/cli#13756)
- docs: fix broken anchor link in release-process-deep-dive by [@&#8203;patrickwehbe](https://github.com/patrickwehbe) in [#&#8203;13688](cli/cli#13688)
- docs: fix broken install command and link/grammar errors by [@&#8203;patrickwehbe](https://github.com/patrickwehbe) in [#&#8203;13690](cli/cli#13690)
- docs: fix duplicated word in primer README by [@&#8203;s3onghyun](https://github.com/s3onghyun) in [#&#8203;13677](cli/cli#13677)

##### :dependabot: Dependencies

- chore(deps): bump github.com/microsoft/dev-tunnels from 0.1.19 to 0.1.27 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;13708](cli/cli#13708)
- chore(deps): bump actions/checkout from 6.0.3 to 7.0.0 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;13703](cli/cli#13703)
- chore(deps): bump github.com/google/go-containerregistry from 0.21.6 to 0.21.7 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;13702](cli/cli#13702)
- chore(deps): bump actions/setup-go from 6.4.0 to 6.5.0 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;13740](cli/cli#13740)
- chore(deps): bump actions/attest from 4.1.0 to 4.1.1 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;13754](cli/cli#13754)
- chore(deps): bump goreleaser/goreleaser-action from 7.2.2 to 7.2.3 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;13759](cli/cli#13759)
- chore(deps): bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;13779](cli/cli#13779)

#### New Contributors

- [@&#8203;patrickwehbe](https://github.com/patrickwehbe) made their first contribution in [#&#8203;13688](cli/cli#13688)
- [@&#8203;s3onghyun](https://github.com/s3onghyun) made their first contribution in [#&#8203;13679](cli/cli#13679)
- [@&#8203;toller892](https://github.com/toller892) made their first contribution in [#&#8203;13681](cli/cli#13681)
- [@&#8203;happysnaker](https://github.com/happysnaker) made their first contribution in [#&#8203;13756](cli/cli#13756)

**Full Changelog**: <cli/cli@v2.95.0...v2.96.0>

### [`v2.95.0`](https://github.com/cli/cli/releases/tag/v2.95.0): GitHub CLI 2.95.0

[Compare Source](cli/cli@v2.94.0...v2.95.0)

#### Read repository files and directories with `gh repo read-file` and `gh repo read-dir`

Two new preview commands read repository contents without cloning:

```shell

# Read a single file to stdout
gh repo read-file README.md --repo cli/cli

# Read from a specific branch, tag, or commit
gh repo read-file go.mod --ref v2.94.0 --repo cli/cli

# Write a file to disk (use --clobber to overwrite)
gh repo read-file README.md --output ./README.md --repo cli/cli

# List the entries in a directory
gh repo read-dir script --repo cli/cli
```

Both commands default to the repository's default branch, accept `--ref` to target any branch, tag, or commit, and support `--json`, `--jq`, and `--template` for scripting. This makes it easy for agents and automation to inspect a repo without a full checkout.

> \[!NOTE]
> `gh repo read-file` and `gh repo read-dir` are in preview and subject to change without notice.

#### What's Changed

##### ✨ Features

- feat: add `repo read-file` and `repo read-dir` by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;13580](cli/cli#13580)
- feat(skills): list available skills when install runs non-interactively by [@&#8203;SamMorrowDrums](https://github.com/SamMorrowDrums) in [#&#8203;13548](cli/cli#13548)
- Support custom CLAUDE\_CONFIG\_DIR in install by [@&#8203;tommaso-moro](https://github.com/tommaso-moro) in [#&#8203;13523](cli/cli#13523)

##### 🐛 Fixes

- fix(skills): stage updates in a temp dir and swap in-place by [@&#8203;SamMorrowDrums](https://github.com/SamMorrowDrums) in [#&#8203;13449](cli/cli#13449)

##### 📚 Docs & Chores

- Make filtering by bot authors more discoverable by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;13642](cli/cli#13642)
- docs(discussion): polish help docs by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;13632](cli/cli#13632)
- Bump Go in devcontainer by [@&#8203;spenserblack](https://github.com/spenserblack) in [#&#8203;13674](cli/cli#13674)

##### :dependabot: Dependencies

- chore(deps): bump golang.org/x/text from 0.37.0 to 0.38.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13640](cli/cli#13640)
- chore(deps): bump charm.land/lipgloss/v2 from 2.0.3 to 2.0.4 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13663](cli/cli#13663)
- chore(deps): bump golang.org/x/term from 0.43.0 to 0.44.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13661](cli/cli#13661)
- chore(deps): bump github/codeql-action from 4.36.1 to 4.36.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13619](cli/cli#13619)
- chore(deps): bump github.com/sigstore/sigstore-go from 1.1.4 to 1.2.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13662](cli/cli#13662)
- chore(deps): bump golang.org/x/crypto from 0.52.0 to 0.53.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13641](cli/cli#13641)

**Full Changelog**: <cli/cli@v2.94.0...v2.95.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMjcuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIzMi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 9, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 9, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 9, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 9, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 10, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 10, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 13, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 13, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 13, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 13, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 16, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 16, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 20, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 20, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 20, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 20, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 21, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 21, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 21, 2026
)

* docs: add custom CA bundle (GH_SSL_CERT_FILE) to features

* fix(ruleset): use int64 for bypass actor_id to match upstream

Upstream cli#13403 switched GitHub database IDs (incl. bypass actor_id) to
int64. Our ruleset request type still used *int, so trunk stopped compiling
once the sync rebased our patch onto that change. Align BypassActor.ActorID
and ParseBypassActor to int64. Patch bump to 1.4.1.
rexovas-open-source Bot added a commit to rexovasgroup/ghx that referenced this pull request Jul 21, 2026
Run `go build ./...` plus tests over the patched packages before publishing
a sync, and make the publish step depend on it via success(). A rebase can
apply our patches cleanly yet break compilation when upstream changes a type
we rely on (e.g. cli#13403 int64 IDs); the previous gate only ran
./internal/config and its custom `if` let publish run even on failure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure the CLI handles GitHub database IDs correctly

4 participants