Releases: octokit/rest.js
v13.0.0
BREAKING CHANGES
-
.get{Scope name}Api()
methods have been removed.Before you could do this
const reposApi = github.getReposApi()
Which is the same as doing
const reposApi = github.repos
So we removed it :)
-
Before a link header could be passed directly to pagination methods like
github.hasPreviousPage(linkHeaderValue)
. This was never documented and is not being used internally, so we decided to remove the functionality to simplify the code -
The
debug
option for the GitHub Client constructor
has been removed. SetDEBUG=node-github:*
environment variable instead -
The current implementation has the upload URL hard coded, while the specification says that it has to be received from the Release API endpoint:
https://developer.github.com/v3/repos/releases/#upload-a-release-assetThe new implementation also requires
contentType
as well ascontentLength
. The latter is not documented, but is required. ThefilePath
option has been replaced with afile
option which can be either a read stream, a buffer or a string.Altogether, uploading an asset before worked like this:
github.repos.getReleaseByTag({ owner: "octokit-fixture-org", repo: "release-assets", tag: "v1.0.0" }) .then(result => { return github.repos.uploadAsset({ owner: "octokit-fixture-org", repo: "release-assets", id: result.data.id, filePath: pathResolve(__dirname, "test-upload.txt"), name: "test-upload.txt", label: "test" }) })
Now it looks like this
github.repos.getReleaseByTag({ owner: "octokit-fixture-org", repo: "release-assets", tag: "v1.0.0" }) .then(result => { return github.repos.uploadAsset({ url: result.data.upload_url, file: "Hello, world!\n", contentType: "text/plain", contentLength: 14, name: "test-upload.txt", label: "test" }) })
If you prefer a higher-level release asset upload library, have a look at https://github.com/gr2m/octokit-release-asset-upload
-
the
followRedirects
option has been removed. Previous problems with non-GET redirects should be handled correctly now, the method is always forwarded as all redirects remain within the same host -
Authentication with
"netrc"
is no longer supported:github.authenticate({ type: "netrc" })
Instead, use the netrc package directly and pass username/password to
"basic"
authenticationconst netrc = require('netrc') const myNetrc = netrc() github.authenticate({ type: 'basic', username: myNetrc['api.github.com'].login, password: myNetrc['api.github.com'].password })
-
passing a custom
Promise
option to the constructor is no longer supportedAll suppertod Node versions (4, 6 and 8) have Promise support built in now. So migrating should be as simple as removing the
Promise
option altogether.
Features
- always follow redirects (61e7a81)
Bug Fixes
- no headers are sent if there are no headers (51eeb0d)
v12.1.0
v12.0.7
v12.0.6
v12.0.5
v12.0.4
v12.0.3
v12.0.2
v12.0.1
v12.0.0
12.0.0 (2017-10-25)
Bug Fixes
- remove trailing slash from
/repos/:owner/:repo/git/refs/
(07b71df) - set content-length: 0 for put/patch requests with empty body (54391c7)
- package: @octokit/fixtures@^2.3.1 (7e4c420)
Chores
- package: update dependencies (cab5531)
BREAKING CHANGES
Unmaintained Node Versions (<4) are no longer supported