@@ -5,3 +5,42 @@ The following changes were made to the Github API package between v3 and v4.
55### Minimum supported PHP version raised
66
77All Framework packages now require PHP 8.3 or newer.
8+
9+ ### Modern API headers and authentication (since 4.1)
10+
11+ Starting with version 4.1, ` fetchUrl() ` automatically sends ` Accept: application/vnd.github+json ` and pins
12+ ` X-GitHub-Api-Version ` to ` 2022-11-28 ` on every request, matching GitHub's currently recommended REST API
13+ conventions. Both headers are only added if you haven't already set them yourself on the HTTP client, so
14+ existing code that manages its own headers is unaffected.
15+
16+ If you need a different API version, set the ` api.version ` option:
17+
18+ ``` php
19+ $options->set('api.version', '2022-11-28');
20+ ```
21+
22+ A new ` gh.token.scheme ` option (default ` token ` , unchanged) lets you send the ` Authorization ` header using the
23+ ` Bearer ` scheme instead, which some fine-grained personal access tokens and GitHub App installation tokens
24+ require:
25+
26+ ``` php
27+ $options->set('gh.token', $token);
28+ $options->set('gh.token.scheme', 'Bearer');
29+ ```
30+
31+ HTTP Basic Authentication (` api.username ` / ` api.password ` ) against ` https://api.github.com ` no longer works —
32+ GitHub removed it in November 2020. Use ` gh.token ` instead. The ` api.username ` / ` api.password ` options remain
33+ available for GitHub Enterprise Server instances that still accept them.
34+
35+ ### ` Authorization ` and ` Repositories\Downloads ` are deprecated (since 4.1)
36+
37+ ` Package\Authorization ` wrapped GitHub's OAuth Authorizations API, and ` Package\Repositories\Downloads ` wrapped
38+ the Repository Downloads API. GitHub has removed both endpoints from github.com (OAuth Authorizations in
39+ November 2020; Downloads years earlier), so every method on these two classes now fails against live GitHub.
40+ The classes are kept so existing ` $github->authorization ` and ` $github->repositories->downloads ` call sites
41+ don't fatal, but they are marked ` @deprecated ` ; ` Authorization ` is scheduled for removal in 5.0.
42+
43+ * Replace ` $github->authorization ` usage with a personal access token passed via the ` gh.token ` option, or the
44+ GitHub Apps / OAuth device flow once supported.
45+ * Replace ` $github->repositories->downloads ` usage with ` $github->repositories->releases ` , which manages
46+ release assets.
0 commit comments