Skip to content

gh api URL encoding change not backwards compatible #10592

Description

@drewzemke-rss

Describe the bug

We were already URL encoding the package names when querying with gh api, and the change in #10384 broke that.

Affected version

2.68.0

Steps to reproduce the behavior

We had a step that looked like this in our action:

run: |
  IMAGE_NAME=$(echo "\"${{ inputs.image-name }}\"" | jq -r @uri)
  SHA=$(gh api \
    -H "Accept: application/vnd.github.v3+json" \
    /orgs/(org-name)/packages/container/$IMAGE_NAME/versions \
    | jq ...)

The action started failing this week as (we assume) more of the GH runners started picking up the new version of gh

Expected vs actual behavior

We expected gh api to (continue to) return package metadata using the request above. Instead we got a 404 message.

Logs

Requests using the latest version of gh returned this error:

gh: Package not found. (HTTP 404)

Activity

  1. williammartin commented on Mar 18, 2025

    @williammartin
    Member

    Hey @drewzemke-rss, sorry for the troubles.

    I've reverted #10630 because it resulted in this and #10628

    I expect we'll release today or tomorrow.

  2. williammartin commented on Mar 19, 2025

    @williammartin
    Member

    Released https://github.com/cli/cli/releases/tag/v2.69.0 which should revert the behaviour to the old way, so I'm going to close this. Please let me know if you experience any more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-apirelating to the gh api commandneeds-triageneeds to be reviewed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions