Skip to content

If repo name is wrong, gha-update fails with obscure error #29

@miketheman

Description

@miketheman

In a new, untested action file, I mistyped the uses: value with a repo name that did not exist.

During the HTTP call for highest version, a 404 is returns, but not handled.

response = await make_request(client, url)
tags.update({t["name"]: t["commit"]["sha"] for t in response.json()})

Leading to this exception:

    | Traceback (most recent call last):
    |   File "<env>/python3.14/site-packages/gha_update/_core.py", line 145, in get_highest_version
    |     tags.update({t["name"]: t["commit"]["sha"] for t in response.json()})
    |                  ~^^^^^^^^
    | TypeError: string indices must be integers, not 'str'

Would it make sense to handle the 404 explicitly in make_request() like the 403, or implement a raise_for_status call more broadly to capture any issues and handle the the explicit ones and let the remaining re-raise with a cleaner message?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions