Skip to content

Update to newer Github API - #65

Open
Hackwar wants to merge 3 commits into
joomla-framework:4.x-devfrom
Hackwar:4.x-github-update
Open

Update to newer Github API#65
Hackwar wants to merge 3 commits into
joomla-framework:4.x-devfrom
Hackwar:4.x-github-update

Conversation

@Hackwar

@Hackwar Hackwar commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Begins aligning the library's HTTP layer with GitHub's current REST API conventions, and flags the two package classes that target endpoints GitHub has since removed. This is phase 0 of a larger modernization pass (see update.md) — purely additive/documentation changes, no public method signatures changed.

  • AbstractGithubObject::fetchUrl() now sends a default Accept: application/vnd.github+json header and pins X-GitHub-Api-Version: 2022-11-28 on every request, so responses don't silently change shape as GitHub advances its default API version. Both are only applied if the consumer hasn't already set that header themselves, and the version string is overridable via a new api.version option.
  • Added a gh.token.scheme option (default token, unchanged) so callers can opt into the Bearer scheme for fine-grained PATs or GitHub App installation tokens without affecting existing classic-PAT consumers.
  • Documented that the Basic Authentication (username/password) fallback in fetchUrl() no longer works against github.com — GitHub removed it in November 2020 — and is retained only for GitHub Enterprise Server compatibility.
  • Expanded the @deprecated docblocks on Package\Authorization and Package\Repositories\Downloads to explain that GitHub has removed the underlying endpoints entirely (OAuth Authorizations API and Basic Auth in Nov 2020; the Downloads API years earlier), that every method in these classes now fails against live GitHub, and that they're kept only so existing $github->authorization / $github->repositories->downloads call sites don't fatal. Points callers at the replacements (GitHub Apps/OAuth device flow, and Repositories\Releases).

Testing Instructions

Rely on the unittests

Documentation Changes Required

See v3-to-v4-update.md

@Hackwar
Hackwar changed the base branch from 3.x-dev to 4.x-dev July 26, 2026 17:28
@Hackwar Hackwar changed the title Switch Github Actions to v4 workflow Update to newer Github API Jul 26, 2026
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.

1 participant