Skip to content

Releases: octokit/rest.js

v13.0.0

18 Apr 18:13
Compare
Choose a tag to compare

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. Set DEBUG=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-asset

    The new implementation also requires contentType as well as contentLength. The latter is not documented, but is required. The filePath option has been replaced with a file 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" authentication

    const 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 supported

    All 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

18 Apr 18:13
Compare
Choose a tag to compare

12.1.0 (2017-11-29)

Features

v12.0.7

18 Apr 18:13
Compare
Choose a tag to compare

12.0.7 (2017-11-28)

Bug Fixes

  • whitelist X-GitHub-SSO header in response (#663) (1e07daf)

v12.0.6

18 Apr 18:13
Compare
Choose a tag to compare

12.0.6 (2017-11-26)

Bug Fixes

  • calculate content-length correctly for raw markdown request (4f819ad)

v12.0.5

18 Apr 18:13
Compare
Choose a tag to compare

12.0.5 (2017-11-22)

Bug Fixes

  • don’t pass filePath as query parameter (3c2e465)

v12.0.4

18 Apr 18:13
Compare
Choose a tag to compare

12.0.4 (2017-11-22)

Bug Fixes

  • package: update follow-redirects to version 1.2.6 (1667120)

v12.0.3

18 Apr 18:13
Compare
Choose a tag to compare

12.0.3 (2017-11-17)

Bug Fixes

  • routes.json validation for project cards and columns (072a53f)

v12.0.2

18 Apr 18:13
Compare
Choose a tag to compare

12.0.2 (2017-11-15)

Bug Fixes

  • TypeScript/Flow definitions (be1d098)

v12.0.1

18 Apr 18:14
Compare
Choose a tag to compare

12.0.1 (2017-10-25)

Bug Fixes

v12.0.0

18 Apr 18:14
Compare
Choose a tag to compare

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