Use int64 for GitHub database IDs and add lint check

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 <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
William Martin 2026-05-12 17:33:57 +02:00
parent 1e6bb88c6d
commit d4cd79e28c
24 changed files with 272 additions and 58 deletions

View file

@ -147,7 +147,7 @@ func deleteRun(opts *DeleteOptions) error {
}
}
for _, cache := range caches.ActionsCaches {
toDelete = append(toDelete, strconv.Itoa(cache.Id))
toDelete = append(toDelete, strconv.FormatInt(cache.Id, 10))
}
} else {
toDelete = append(toDelete, opts.Identifier)

View file

@ -22,7 +22,7 @@ var CacheFields = []string{
type Cache struct {
CreatedAt time.Time `json:"created_at"`
Id int `json:"id"`
Id int64 `json:"id"`
Key string `json:"key"`
LastAccessedAt time.Time `json:"last_accessed_at"`
Ref string `json:"ref"`