GithubHelp home page GithubHelp logo

octokit / request.js Goto Github PK

View Code? Open in Web Editor NEW
225.0 29.0 62.0 4.35 MB

Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node

License: MIT License

TypeScript 95.38% JavaScript 4.62%
octokit-js plugin hacktoberfest

request.js's Introduction

request.js

Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node

@latest Build Status

@octokit/request is a request library for browsers & node that makes it easier to interact with GitHub’s REST API and GitHub’s GraphQL API.

It uses @octokit/endpoint to parse the passed options and sends the request using fetch. You can pass a custom fetch function using the options.request.fetch option, see below.

Features

🤩 1:1 mapping of REST API endpoint documentation, e.g. Add labels to an issue becomes

request("POST /repos/{owner}/{repo}/issues/{number}/labels", {
  mediaType: {
    previews: ["symmetra"],
  },
  owner: "octokit",
  repo: "request.js",
  number: 1,
  labels: ["🐛 bug"],
});

👶 Small bundle size (<4kb minified + gzipped)

😎 Authenticate with any of GitHubs Authentication Strategies.

👍 Sensible defaults

  • baseUrl: https://api.github.com
  • headers.accept: application/vnd.github.v3+json
  • headers['user-agent']: octokit-request.js/<current version> <OS information>, e.g. octokit-request.js/1.2.3 Node.js/10.15.0 (macOS Mojave; x64)

👌 Simple to test: mock requests by passing a custom fetch method.

🧐 Simple to debug: Sets error.request to request options causing the error (with redacted credentials).

Usage

Browsers Load @octokit/request directly from esm.sh
<script type="module">
  import { request } from "https://esm.sh/@octokit/request";
</script>
Node

Install with npm install @octokit/request

const { request } = require("@octokit/request");
// or: import { request } from "@octokit/request";

REST API example

// Following GitHub docs formatting:
// https://developer.github.com/v3/repos/#list-organization-repositories
const result = await request("GET /orgs/{org}/repos", {
  headers: {
    authorization: "token 0000000000000000000000000000000000000001",
  },
  org: "octokit",
  type: "private",
});

console.log(`${result.data.length} repos found.`);

GraphQL example

For GraphQL request we recommend using @octokit/graphql

const result = await request("POST /graphql", {
  headers: {
    authorization: "token 0000000000000000000000000000000000000001",
  },
  query: `query ($login: String!) {
    organization(login: $login) {
      repositories(privacy: PRIVATE) {
        totalCount
      }
    }
  }`,
  variables: {
    login: "octokit",
  },
});

Alternative: pass method & url as part of options

Alternatively, pass in a method and a url

const result = await request({
  method: "GET",
  url: "/orgs/{org}/repos",
  headers: {
    authorization: "token 0000000000000000000000000000000000000001",
  },
  org: "octokit",
  type: "private",
});

Authentication

The simplest way to authenticate a request is to set the Authorization header directly, e.g. to a personal access token.

const requestWithAuth = request.defaults({
  headers: {
    authorization: "token 0000000000000000000000000000000000000001",
  },
});
const result = await requestWithAuth("GET /user");

For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by @octokit/auth.

const { createAppAuth } = require("@octokit/auth-app");
const auth = createAppAuth({
  appId: process.env.APP_ID,
  privateKey: process.env.PRIVATE_KEY,
  installationId: 123,
});
const requestWithAuth = request.defaults({
  request: {
    hook: auth.hook,
  },
  mediaType: {
    previews: ["machine-man"],
  },
});

const { data: app } = await requestWithAuth("GET /app");
const { data: app } = await requestWithAuth(
  "POST /repos/{owner}/{repo}/issues",
  {
    owner: "octocat",
    repo: "hello-world",
    title: "Hello from the engine room",
  },
);

request()

request(route, options) or request(options).

Options

name type description
route String **Required**. If route is set it has to be a string consisting of the request method and URL, e.g. GET /orgs/{org}
options.baseUrl String The base URL that route or url will be prefixed with, if they use relative paths. Defaults to https://api.github.com.
options.headers Object Custom headers. Passed headers are merged with defaults:
headers['user-agent'] defaults to octokit-rest.js/1.2.3 (where 1.2.3 is the released version).
headers['accept'] defaults to application/vnd.github.v3+json.
Use options.mediaType.{format,previews} to request API previews and custom media types.
options.method String Any supported http verb, case insensitive. Defaults to Get.
options.mediaType.format String Media type param, such as `raw`, `html`, or `full`. See Media Types.
options.mediaType.previews Array of strings Name of previews, such as `mercy`, `symmetra`, or `scarlet-witch`. See GraphQL Schema Previews. Note that these only apply to GraphQL requests and have no effect on REST routes.
options.url String **Required**. A path or full URL which may contain :variable or {variable} placeholders, e.g. /orgs/{org}/repos. The url is parsed using url-template.
options.data Any Set request body directly instead of setting it to JSON based on additional parameters. See "The `data` parameter" below.
options.request.fetch Function Custom replacement for fetch. Useful for testing or request hooks.
options.request.hook Function Function with the signature hook(request, endpointOptions), where endpointOptions are the parsed options as returned by endpoint.merge(), and request is request(). This option works great in conjuction with before-after-hook.
options.request.signal new AbortController().signal Use an AbortController instance to cancel a request. In node you can only cancel streamed requests.
options.request.log object Used for internal logging. Defaults to console.
options.request.parseSuccessResponseBody boolean If set to false the returned `response` will be passed through from `fetch`. This is useful to stream response.body when downloading files from the GitHub API.

All other options except options.request.* will be passed depending on the method and url options.

  1. If the option key is a placeholder in the url, it will be used as replacement. For example, if the passed options are {url: '/orgs/{org}/repos', org: 'foo'} the returned options.url is https://api.github.com/orgs/foo/repos
  2. If the method is GET or HEAD, the option is passed as query parameter
  3. Otherwise the parameter is passed in the request body as JSON key.

Result

request returns a promise. If the request was successful, the promise resolves with an object containing 4 keys:

key type description
status Integer Response status status
url String URL of response. If a request results in redirects, this is the final URL. You can send a HEAD request to retrieve it without loading the full response body.
headers Object All response headers
data Any The response body as returned from server. If the response is JSON then it will be parsed into an object

If an error occurs, the promise is rejected with an error object containing 3 keys to help with debugging:

  • error.status The http response status code
  • error.request The request options such as method, url and data
  • error.response The http response object with url, headers, and data

If the error is due to an AbortSignal being used, the resulting AbortError is bubbled up to the caller.

request.defaults()

Override or set default options. Example:

const myrequest = require("@octokit/request").defaults({
  baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
  headers: {
    "user-agent": "myApp/1.2.3",
    authorization: `token 0000000000000000000000000000000000000001`,
  },
  org: "my-project",
  per_page: 100,
});

myrequest(`GET /orgs/{org}/repos`);

You can call .defaults() again on the returned method, the defaults will cascade.

const myProjectRequest = request.defaults({
  baseUrl: "https://github-enterprise.acme-inc.com/api/v3",
  headers: {
    "user-agent": "myApp/1.2.3",
  },
  org: "my-project",
});
const myProjectRequestWithAuth = myProjectRequest.defaults({
  headers: {
    authorization: `token 0000000000000000000000000000000000000001`,
  },
});

myProjectRequest now defaults the baseUrl, headers['user-agent'], org and headers['authorization'] on top of headers['accept'] that is set by the global default.

request.endpoint

See https://github.com/octokit/endpoint.js. Example

const options = request.endpoint("GET /orgs/{org}/repos", {
  org: "my-project",
  type: "private",
});

// {
//   method: 'GET',
//   url: 'https://api.github.com/orgs/my-project/repos?type=private',
//   headers: {
//     accept: 'application/vnd.github.v3+json',
//     authorization: 'token 0000000000000000000000000000000000000001',
//     'user-agent': 'octokit/endpoint.js v1.2.3'
//   }
// }

All of the @octokit/endpoint API can be used:

Special cases

The data parameter – set request body directly

Some endpoints such as Render a Markdown document in raw mode don’t have parameters that are sent as request body keys, instead the request body needs to be set directly. In these cases, set the data parameter.

const response = await request("POST /markdown/raw", {
  data: "Hello world github/linguist#1 **cool**, and #1!",
  headers: {
    accept: "text/html;charset=utf-8",
    "content-type": "text/plain",
  },
});

// Request is sent as
//
//     {
//       method: 'post',
//       url: 'https://api.github.com/markdown/raw',
//       headers: {
//         accept: 'text/html;charset=utf-8',
//         'content-type': 'text/plain',
//         'user-agent': userAgent
//       },
//       body: 'Hello world github/linguist#1 **cool**, and #1!'
//     }
//
// not as
//
//     {
//       ...
//       body: '{"data": "Hello world github/linguist#1 **cool**, and #1!"}'
//     }

Set parameters for both the URL/query and the request body

There are API endpoints that accept both query parameters as well as a body. In that case you need to add the query parameters as templates to options.url, as defined in the RFC 6570 URI Template specification.

Example

request(
  "POST https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
  {
    name: "example.zip",
    label: "short description",
    headers: {
      "content-type": "text/plain",
      "content-length": 14,
      authorization: `token 0000000000000000000000000000000000000001`,
    },
    data: "Hello, world!",
  },
);

Set a custom Agent to your requests

The way to pass a custom Agent to requests is by creating a custom fetch function and pass it as options.request.fetch. A good example can be undici's fetch implementation.

Example (See example in CodeSandbox)

import { request } from "@octokit/request";
import { fetch as undiciFetch, Agent } from "undici";

/** @type {typeof import("undici").fetch} */
const myFetch = (url, options) => {
  return undiciFetch(url, {
    ...options,
    dispatcher: new Agent({
      keepAliveTimeout: 10,
      keepAliveMaxTimeout: 10,
    }),
  });
};

const { data } = await request("GET /users/{username}", {
  username: "octocat",
  headers: {
    "X-GitHub-Api-Version": "2022-11-28",
  },
  options: {
    request: {
      fetch: myFetch,
    },
  },
});

LICENSE

MIT

request.js's People

Contributors

baoshan avatar codebytere avatar dependabot[bot] avatar foolip avatar gr2m avatar gr2m-test avatar greenkeeper[bot] avatar hughrawlinson avatar jakub-g avatar jamesmgreene avatar jhutchings1 avatar jovel avatar kfcampbell avatar lucianbuzzo avatar mcataford avatar nickfloyd avatar nikhilgupta345 avatar nmattia avatar octokitbot avatar orozcoadrian avatar oscard0m avatar pvdlg avatar ram-nad avatar renovate[bot] avatar romanbalayan avatar timrogers avatar tsusdere avatar uzlopak avatar wolfy1339 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

request.js's Issues

An in-range update of prettier is breaking the build 🚨

The devDependency prettier was updated from 1.18.0 to 1.18.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for 1.18.1

🔗 Changelog

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add test for `data` being a readstream

This test was originally in octokit/rest.js:
https://github.com/octokit/rest.js/blob/8f081956a14ec19ce3543efa3d9838d743f51ac9/test/unit/upload-asset-test.js

const octokit = new Octokit();

nock("https://upload.test", {
  reqheaders: {
    "content-type": "text/plain"
  }
})
  .post("/repos/octocat/hello-world/releases/123/assets", function(data) {
    return fs.readFileSync(__filename, "utf8") === data;
  })
  .query({
    name: "package.json"
  })
  .reply(200, { ok: true });

return octokit.repos.uploadReleaseAsset({
  baseUrl: "https://upload.test",
  headers: {
    "content-type": "text/plain"
  },
  owner: "octocat",
  repo: "hello-world",
  release_id: 123,
  data: fs.createReadStream(__filename),
  name: "package.json"
});

An in-range update of @octokit/types is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The dependency @octokit/types was updated from 2.10.0 to 2.11.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@octokit/types is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • test (13): There are 2 failures, 0 warnings, and 0 notices.
  • test (12): There are 1 failures, 0 warnings, and 0 notices.
  • test (10): There are 2 failures, 0 warnings, and 0 notices.

Release Notes for v2.11.0

2.11.0 (2020-04-19)

Features

  • Add optional defaults type parameter to EndpointInterface & RequestInterface, pass on option types from .defaults(options) (#48) (17acf10)
Commits

The new version differs by 1 commits.

  • 17acf10 feat: Add optional defaults type parameter to EndpointInterface & RequestInterface, pass on option types from .defaults(options) (#48)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Request an access token failed with a 406 Not Acceptable error

octokit.request('POST https://github.com/login/oauth/access_token', {
      client_id: 'xxx',
      client_secret: 'xxx',
      code: 'xxx'
    });

but got:

{ HttpError
    at response.text.then.message (/usr/src/app/node_modules/@octokit/request/dist-node/index.js:66:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HttpError',
  status: 406,
  headers:
   { 'cache-control': 'no-cache',
     connection: 'close',
     'content-security-policy':
      'default-src \'none\'; base-uri \'self\'; block-all-mixed-content; connect-src \'self\' uploads.github.com www.githubstatus.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src github.githubassets.com; form-action \'self\' github.com gist.github.com; frame-ancestors \'none\'; frame-src render.githubusercontent.com; img-src \'self\' data: github.githubassets.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; manifest-src \'self\'; media-src \'none\'; script-src github.githubassets.com; style-src \'unsafe-inline\' github.githubassets.com',
     'content-type': 'text/html',
     date: 'Mon, 05 Aug 2019 09:45:17 GMT',
     'expect-ct':
      'max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"',
     'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
     server: 'GitHub.com',
     'set-cookie':
      'has_recent_activity=1; path=/; expires=Mon, 05 Aug 2019 10:45:17 -0000, ignored_unsupported_browser_notice=false; path=/',
     status: '406 Not Acceptable',
     'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
     'transfer-encoding': 'chunked',
     vary: 'X-PJAX',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-request-id': 'D9D4:CE13:12F09C0:1D5FA50:5D47FAAD',
     'x-request-id': '238cdf6e-28ac-4d06-8a9f-00ff204ceedc',
     'x-xss-protection': '1; mode=block' },
  request:
   { method: 'POST',
     url: 'https://github.com/login/oauth/access_token',
     headers:
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.28.7 Node.js/10.16.0 (Linux 4.9; x64)',
        'content-type': 'application/json; charset=utf-8' },
     body:
      '{"client_id":"xxx","client_secret":"xxx","code":"xxx"}',
     request: { hook: [Function: bound bound register] } } }

Not sure what I am doing wrong

An in-range update of nyc is breaking the build 🚨

The devDependency nyc was updated from 13.1.0 to 13.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

nyc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/nyc-13.2.0 at 100.0% (Details).

Commits

The new version differs by 17 commits.

  • 29e6f5e chore(release): 13.2.0
  • e95856c chore: Update dependencies. (#978)
  • 921d386 fix: Create directory for merge destination. (#979)
  • df2730d feat: Option Plugins (#948)
  • 35cd49a feat: document the fact that cacheDir is configurable (#968)
  • ff834aa feat: avoid hardcoded HOME for spawn-wrap working dir (#957)
  • 35710b1 build: move windows tests to travis (#961)
  • 93cb5c1 tests: coverage for temp-dir changes (#964)
  • d566efe test: stop using LAZY_LOAD_COUNT (#960)
  • f23d474 chore: update stale bot config with feedback (#958)
  • 62d7fb8 chore: slight tweak to position of test
  • 28b6d09 fix: missing command temp-directory (#928)
  • 40afc5f fix: nyc processing files not covered by include when all is enabled. (#914)
  • ba22a26 docs(readme): Update to reflect .nycrc.json support (#934)
  • 2dbb82d chore: enable probot-stale

There are 17 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of webpack is breaking the build 🚨

The devDependency webpack was updated from 4.26.1 to 4.27.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v4.27.0

Features

  • When using functions as plugins they are now also called with the compiler as parameter
    • This make it possible to use arrow functions as plugins
  • splitChunks.maxSize now emits a warning when minSize > maxSize
  • Loaders have now access to a getResolve method to create their own resolver function with custom options

Bugfixes

  • splitChunks.cacheGroups.xxx.enforce now behaves as documented and enforce chunk creation
  • splitChunks.cacheGroups.xxx.enforce now no longer deletes minSize for maxSize
  • fixes a bug where splitChunks cause cacheGroups to be incorrectly merged when using the same name
    • now conditions are considered per cacheGroup
    • the correct cache group comment is displayed in stats
  • fixes a bug which causes providedExports not to be updated on rebuilds when using export * from
Commits

The new version differs by 12 commits.

  • f47bf8b 4.27.0
  • a67ffcd Merge pull request #8452 from webpack/feature/resolveWithOptions
  • 96f625c Merge pull request #8457 from webpack/bugfix/rebuild-provided-exports
  • 56feccc convert test case to normal function for node.js 6 support
  • 2f4296e fix a bug which causes incorrect providedExports for cached modules
  • f944002 Merge pull request #8451 from webpack/bugfix/split-chunks
  • 162da1c add getResolve method to loader context
  • 3b46b48 enforce doesn't affect minSize for maxSize
  • 72a8a1f Merge pull request #8440 from Connormiha/oprimize-chunk-can-be-integrated
  • 537d3e4 Cache hasRunstime in chunk
  • e3e8a68 Merge pull request #8405 from xiaoxiaojx/fix-function-plugin-apply
  • 70b9a1b fix parameter missing when plugin type is a funtion

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of deprecation is breaking the build 🚨

The dependency deprecation was updated from 2.0.0 to 2.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

deprecation is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v2.1.0

2.1.0 (2019-06-13)

Features

Commits

The new version differs by 15 commits.

  • 15c0d6d ci(workflow): trying to make semantic-release work
  • c84c023 ci(workflow): trying to make semantic-release work
  • 8f26a5e ci(workflow): trying to make semantic-release work
  • 96d825e ci(workflow): trying to make semantic-release work
  • da24ba0 ci(workflow): fix syntax
  • c7e70ba ci(workflow): fix syntax
  • 57d6ff1 ci(workflow): trying to make semantic-release work
  • 67b66a0 docs(README): install for Node & Browser
  • 8af1c09 ci: adapt workflow for pika setup
  • af1c945 test: adapt tests
  • b6f77b3 build(gitignore): node_modules, pkg
  • 33ee5d1 feat: module export & support for https://www.pika.dev/cdn
  • 25bf7ba build(package): lock file
  • 79e58d0 build(package): pika pack setup
  • fdeb2e8 build(deps): bump js-yaml from 3.12.2 to 3.13.1

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semantic-release is breaking the build 🚨

The devDependency semantic-release was updated from 17.0.2 to 17.0.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v17.0.3

17.0.3 (2020-02-13)

Bug Fixes

  • pass a branch name to getGitAuthUrl (e7bede1)
Commits

The new version differs by 6 commits.

  • e7bede1 fix: pass a branch name to getGitAuthUrl
  • 8426b42 chore(package): update tempy to version 0.4.0
  • 804fc2a docs(Troubleshooting): release not found in prereleases branch (e.g. beta) after rebase on master) (#1444)
  • 389e331 chore(package): update got to version 10.5.2
  • a93c96f revert: fix: allow plugins to set environment variables to be used by other plugins
  • 68f7e92 fix: allow plugins to set environment variables to be used by other plugins

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of cypress is breaking the build 🚨

The devDependency cypress was updated from 3.1.2 to 3.1.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

cypress is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of universal-user-agent is breaking the build 🚨

The dependency universal-user-agent was updated from 2.0.3 to 2.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

universal-user-agent is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/universal-user-agent-2.1.0 at 100.0% (Details).

Release Notes for v2.1.0

2.1.0 (2019-05-08)

Features

  • add typescript definition (f75c2e9)
Commits

The new version differs by 7 commits.

  • f75c2e9 feat: add typescript definition
  • 8369bd9 chore(package): update lockfile package-lock.json
  • 4c2d814 chore(package): update nyc to version 14.0.0
  • ac643b4 chore(package): update lockfile package-lock.json
  • 3a49d56 chore(package): update mocha to version 6.0.0
  • 7d33425 chore(package): update lockfile package-lock.json
  • 5613aa4 chore(package): update sinon to version 7.2.4

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of mocha is breaking the build 🚨

The devDependency mocha was updated from 6.0.2 to 6.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/mocha-6.1.0 at 100.0% (Details).

Release Notes for v6.1.0

6.1.0 / 2019-04-07

🔒 Security Fixes

  • #3845: Update dependency "js-yaml" to v3.13.0 per npm security advisory (@plroebuck)

🎉 Enhancements

  • #3766: Make reporter constructor support optional options parameter (@plroebuck)
  • #3760: Add support for config files with .jsonc extension (@sstephant)

📠 Deprecations

These are soft-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha:

🐛 Fixes

  • #3829: Use cwd-relative pathname to load config file (@plroebuck)
  • #3745: Fix async calls of this.skip() in "before each" hooks (@juergba)
  • #3669: Enable --allow-uncaught for uncaught exceptions thrown inside hooks (@givanse)

and some regressions:

📖 Documentation

🔩 Other

  • #3830: Replace dependency "findup-sync" with "find-up" for faster startup (@cspotcode)
  • #3799: Update devDependencies to fix many npm vulnerabilities (@XhmikosR)
Commits

The new version differs by 28 commits.

  • f4fc95a Release v6.1.0
  • bd29dbd update CHANGELOG for v6.1.0 [ci skip]
  • aaf2b72 Use cwd-relative pathname to load config file (#3829)
  • b079d24 upgrade deps as per npm audit fix; closes #3854
  • e87c689 Deprecate this.skip() for "after all" hooks (#3719)
  • 81cfa90 Copy Suite property "root" when cloning; closes #3847 (#3848)
  • 8aa2fc4 Fix issue 3714, hide pound icon showing on hover header on docs page (#3850)
  • 586bf78 Update JS-YAML to address security issue (#3845)
  • d1024a3 Update doc examples "tests.html" (#3811)
  • 1d570e0 Delete "/docs/example/chai.js"
  • ade8b90 runner.js: "self.test" undefined in Browser (#3835)
  • 0098147 Replace findup-sync with find-up for faster startup (#3830)
  • d5ba121 Remove "package" flag from sample config file because it can only be passes as CLI arg (#3793)
  • a3089ad update package-lock
  • 75430ec Upgrade yargs-parser dependency to avoid loading 2 copies of yargs

There are 28 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of webpack-cli is breaking the build 🚨

The devDependency webpack-cli was updated from 3.2.1 to 3.2.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/webpack-cli-3.2.2 at 100.0% (Details).

Commits

The new version differs by 88 commits.

There are 88 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of fetch-mock is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency fetch-mock was updated from 9.3.0 to 9.3.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

fetch-mock is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • test (12): There are 1 failures, 0 warnings, and 0 notices.
  • test (10): There are 2 failures, 0 warnings, and 0 notices.
  • test (8): There are 1 failures, 0 warnings, and 0 notices.

Commits

The new version differs by 7 commits.

  • d22e983 linked to cheatsheet EVERYWHERE
  • 1d2557d Merge pull request #524 from wheresrhys/cheatsheet
  • 1dfc6c2 completed cheatsheet
  • 7efa6c5 cheatsheet formatting
  • 438c835 refined set up/teardown section of cheatsheet
  • 6a2d449 midway through writing cheatsheet content
  • 633cf3e improve documentation for when to use a named matcher

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 12.12.5 to 12.12.6.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch master on the remote Git repository with URL https://x-access-token:[secure]@github.com/octokit/request.js.git.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot 📦🚀

How to properly import request.js along with its dependencies in an HTML file for browsers?

I am sorry to be asking this here, but I have not been able to run the codes in the README. I sought help on SO too but I am afraid nothing came of it.  

I have the following html file (sans the api token) -

<head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
    <script type="module">
        import { request } from "https://cdn.pika.dev/@octokit/request";
    </script>
    <script>
        const octokitRequest = require('@octokit/request');
        myAsyncMethod()
        async function myAsyncMethod () {
            const result = await request("GET /users/:user/repos", {
                headers: {
                    authorization: "token <your token>"
                },
                user: "armsp"
                });
            console.log(`${result.data.length} repos found.`);
        }
    </script>  
</body>

This is the error I get -  

require.min.js:1 Uncaught Error: Module name "@octokit/request" has not been loaded yet for context: _. Use require([])
https://requirejs.org/docs/errors.html#notloaded
    at makeError (require.min.js:1)
    at Object.s [as require] (require.min.js:1)
    at requirejs (require.min.js:1)
    at github-api-test.html:11

github-api-test.html:1 Uncaught SyntaxError: The requested module '/universal-user-agent/^4.0.0/es2019/universal-user-agent.js' does not provide an export named 'default'

I tried to download the js file itself and include it in script tag the usual way, but I don't see any request.js file in src folder, all are .ts files. I don't know how to make sense of it.

Any help would be appreciated.

An in-range update of @octokit/request-error is breaking the build 🚨

The dependency @octokit/request-error was updated from 1.0.2 to 1.0.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@octokit/request-error is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v1.0.3

1.0.3 (2019-06-14)

Bug Fixes

  • correct import statement in usage (dc72ce8)
  • README: unpkg.com -> cdn.pika.dev (adbdb48)
FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 12.0.6 to 12.0.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add tests for `data` set to Buffer and ArrayBuffer

compare test from @octokit/rest v16

const stringToArrayBuffer = require("string-to-arraybuffer");
const { getInstance } = require("../util");

require("../mocha-node-setup");

describe("api.github.com", () => {
  let octokit;

  beforeEach(() => {
    return getInstance("release-assets", {
      auth: "token 0000000000000000000000000000000000000001"
    }).then(instance => {
      octokit = instance;
    });
  });

  it("octokit.request with Buffer data", () => {
    return octokit.repos
      .getReleaseByTag({
        owner: "octokit-fixture-org",
        repo: "release-assets",
        tag: "v1.0.0"
      })

      .then(result => {
        return octokit.request({
          method: "POST",
          url: result.data.upload_url,
          headers: {
            "content-type": "text/plain"
          },
          data: Buffer.from("Hello, world!\n"),
          name: "test-upload.txt",
          label: "test"
        });
      });
  });

  it("octokit.repos.uploadReleaseAsset as ArrayBuffer", () => {
    return octokit.repos
      .getReleaseByTag({
        owner: "octokit-fixture-org",
        repo: "release-assets",
        tag: "v1.0.0"
      })

      .then(result => {
        return octokit.request({
          method: "POST",
          url: result.data.upload_url,
          headers: {
            "content-type": "text/plain"
          },
          data: stringToArrayBuffer("Hello, world!\n"),
          name: "test-upload.txt",
          label: "test"
        });
      });
  });
});

This is part of https://github.com/octokit/rest.js/issues/1546

pass request-compatible API to `request.hook(request, options)`

follow up for #71

Right now, the request function passed to request.hook(request, options) is the fetch wrapper. It does not have the .endpoint and .defaults keys.

A fix would could look like this

-   return endpointOptions.request.hook((options: Defaults) => {
-     return fetchWrapper(endpoint.parse(options));
-   }, endpointOptions);
+   const request = (options, route) => {
+     return fetchWrapper(endpoint.parse(endpoint.merge(options, route)));
+   };
+
+   Object.assign(request, {
+     endpoint,
+     defaults: withDefaults.bind(null, endpoint)
+   });
+
+   return endpointOptions.request.hook(request, endpointOptions);

request.hook has wrong signature

The method signature should be hook (request, options) {}, not hook (options, request) {} 🤦‍♂🤕

This is the signature we have in @octokit/rest for octokit.hook.wrap('request', hook)

read information from multiple repositories at once

Fairly novice question, I know, but I've got a list of Repos whose description I'd like to fetch. Currently, I'm reading each one separately, however this takes time. I'm just wondering if / how I could do a batch request to get a list of all repositories I ask for.

Thanks

Understanding Request Authentication for Installation

Hello,

using @octokit/request v5.4.5

I am requesting the github interface in order to obtain the list of private projects of an organization using the request library. I have the correct right set for the installation and got an installation token calling:

await session.request(
            'POST /app/installations/:installation_id/access_tokens',
            {
                headers: {
                    authorization: `token ${ appToken }`,
                },
                installation_id: installationId,
                permissions: {
                    organization_projects: 'write',
                }
            },
        );

Everything seems to go well...

core_1  |   {
core_1  |     token: 'v1.b4b574f9ae835800ab6326a96525e034a8d697c3',
core_1  |     expires_at: '2020-07-14T13:45:57Z',
core_1  |     permissions: { organization_projects: 'write' },
core_1  |     repository_selection: 'selected'
core_1  |   },

but then calling

await session.request(
            'GET /app/orgs/:org/projects',
            {
                headers: {
                    authorization: `token ${ installToken }`,
                },
                org,
            },
        );

I have the following error:

core_1  | InstallationAccess ERROR RequestError [HttpError]: Not Found
core_1  |     at /node/app/node_modules/@octokit/request/dist-node/index.js:66:23
core_1  |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
core_1  |     at async getInstallationAuthentication (/node/app/node_modules/@octokit/auth-app/dist-node/index.js:148:7)
core_1  |     at async hook (/node/app/node_modules/@octokit/auth-app/dist-node/index.js:280:7)
[...]
core_1  |   status: 404,
core_1  |   headers: {
core_1  |     'access-control-allow-origin': '*',
core_1  |     'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
core_1  |     connection: 'close',
core_1  |     'content-encoding': 'gzip',
core_1  |     'content-security-policy': "default-src 'none'",
core_1  |     'content-type': 'application/json; charset=utf-8',
core_1  |     date: 'Tue, 14 Jul 2020 15:23:07 GMT',
core_1  |     'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
core_1  |     server: 'GitHub.com',
core_1  |     status: '404 Not Found',
core_1  |     'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
core_1  |     'transfer-encoding': 'chunked',
core_1  |     vary: 'Accept-Encoding, Accept, X-Requested-With',
core_1  |     'x-content-type-options': 'nosniff',
core_1  |     'x-frame-options': 'deny',
core_1  |     'x-github-media-type': 'github.inertia-preview; format=json, github.machine-man-preview; format=json',
core_1  |     'x-github-request-id': '93C2:5190:6DD240:EFF5EE:5F0DCDDB',
core_1  |     'x-xss-protection': '1; mode=block'
core_1  |   },
core_1  |   request: {
core_1  |     method: 'POST',
core_1  |     url: 'https://api.github.com/app/installations//access_tokens',
core_1  |     headers: {
core_1  |       accept: 'application/vnd.github.inertia-preview+json,application/vnd.github.machine-man-preview+json',
core_1  |       'user-agent': '[REDACTED] octokit-rest.js/18.0.0 octokit-core.js/3.1.0 Node.js/12.18.1 (Linux 5.3; x64)',
core_1  |       authorization: 'bearer [REDACTED]',
core_1  |       'content-type': 'application/json; charset=utf-8'
core_1  |     },
core_1  |     body: '{}',
core_1  |     request: { hook: [Function: bound bound register] }
core_1  |   },
core_1  |   documentation_url: 'https://developer.github.com/v3'
core_1  | }

My understanding is a default hook is triggered to obtain another installation authentication but has no information for the installation_id and therefore fails.
I do not understand this behavior. Am I missing something? Should I have configured a specific hook before being able to access the endpoint ? Thank you for your help @gr2m

PS the session object is the result of:

new Octokit({
            authStrategy: createAppAuth,
            auth: {
                id: process.env.GITHUB_APP_ID,
                privateKey: pemKey,
            },
            userAgent: 'blabla',
            baseUrl: 'https://api.github.com',
            previews: ['inertia', 'machine-man'],
        });

Automatically retry requests on server errors (502)

I've been recently experiencing 502 server errors from GitHub while using this library. I'm planning to add some retry logic on my application code, but would this make sense as part of this library instead?

Broken in node. `require('@octokit/request')` does not return an async function

Just trying to run any request at all in node, for example:

const octokitRequest = require('@octokit/request');
const result = await octokitRequest('GET /jdunk');

(as per the README documentation)

...yields the following error:

const result = await octokitRequest('GET /jdunk');
               ^^^^^

SyntaxError: await is only valid in async function
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

An in-range update of fetch-mock is breaking the build 🚨

The devDependency fetch-mock was updated from 7.5.0 to 7.5.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

fetch-mock is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 2 commits.

  • e50ffe3 Merge pull request #453 from birtles/fixCaptureStackTrace
  • 22f1ee0 Check for Error.captureStackTrace before using it

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Extract src/http-error.ts into its own plugin

It’s currently used in @octokit/rest and some other plugins. Requiring internal files is no longer possible since the pika build, and I planned to create a @octokit/http-error package anyway for some time now

An in-range update of semantic-release is breaking the build 🚨

The devDependency semantic-release was updated from 15.12.3 to 15.12.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v15.12.4

15.12.4 (2018-11-30)

Bug Fixes

  • remove unnecessary branch parameter from push function (ffe1062)
Commits

The new version differs by 1 commits.

  • ffe1062 fix: remove unnecessary branch parameter from push function

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

add test for request timeout

Compare to test from @octokit/rest v16.

  it("timeout", () => {
    nock("https://request-errors-test.com")
      .get("/")
      .delay(2000)
      .reply(200, {});

    const octokit = new Octokit({
      baseUrl: "https://request-errors-test.com",
      request: {
        timeout: 100
      }
    });

    return octokit
      .request("/")

      .then(() => {
        throw new Error("should not resolve");
      })

      .catch(error => {
        expect(error.name).to.equal("HttpError");
        expect(error.status).to.equal(500);
        expect(error.message).to.match(/timeout/);
      });
  });

This is part of https://github.com/octokit/rest.js/issues/1546

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 12.6.9 to 12.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add back browser tests

Instead of running all tests, make separate tests which only test the basics, as jest is not compatible with Cypress

follow up #45

options.request.fetch for simple mocking and hooks

Add an option that allows users to pass their own fetch-compatible method to be used for the actual request.

This is great for testing, e.g. with fetch-mock. And some environments such a Electron or React Native might want to use their own native request methods

TypeError: oldEndpoint.defaults is not a function

After upgrading semantic-release/github, our dry run of our npm build started to fail with this stack trace

npx semantic-release
[11:02:00 AM] [semantic-release] › ℹ Running semantic-release version 15.13.12
[11:02:00 AM] [semantic-release] › ✖ An error occurred while running semantic-release: TypeError: oldEndpoint.defaults is not a function
at withDefaults (../node_modules/@octokit/request/lib/with-defaults.js:6:32)
at Object. (../node_modules/@octokit/request/index.js:8:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (../node_modules/@octokit/rest/lib/constructor.js:3:18)
TypeError: oldEndpoint.defaults is not a function
at withDefaults (../node_modules/@octokit/request/lib/with-defaults.js:6:32)
at Object. (../node_modules/@octokit/request/index.js:8:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (../node_modules/@octokit/rest/lib/constructor.js:3:18)%

I think this may actually be an issue with octokit/request - so I decided to create an issue here.

It looks like in @octokit/request/lib/index.js withDefaults is expecting oldEndpoint.defaults to exist, but upon inspecting the object myself, I noticed defaults is actually a level deeper - oldEndpoint.endpoint.defaults. By updating @octokit/request/index.js line 1 to add .endpoint at the end of the line, in my node-modules resolved the error. const endpoint = require('@octokit/endpoint').endpoint.. But this is not a good workaround when it comes to publishing the project in the CI

@octokit/[email protected] and @octokit/[email protected] were installed as dependencies of semantic-release/github. If a different version should be used by semantic-release/github, I could open an issue there too.

An in-range update of fetch-mock is breaking the build 🚨

The devDependency fetch-mock was updated from 7.3.8 to 7.3.9.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

fetch-mock is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of webpack is breaking the build 🚨

The devDependency webpack was updated from 4.29.0 to 4.29.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/webpack-4.29.1 at 100.0% (Details).

Release Notes for v4.29.1

Bugfixes

  • add missing __esModule flag when modules are concatenated, but without usage information
Commits

The new version differs by 14 commits.

  • 6934b98 4.29.1
  • 960f396 Merge pull request #8686 from MarkPollmann/patch-1
  • 8627743 Merge pull request #8678 from bhavya9107/patch-1
  • 915c32d docs(README): remove to from link
  • 9737a3b Update README.md
  • f654a49 docs(README):Update index
  • c957338 docs(README): newline after index
  • 09cf713 docs(README): add index
  • 07d4d85 Merge pull request #8676 from hulkish/fix-side-effects-example
  • 2209b8a rebuild examples
  • 780c17e fix side-effects example
  • 2fe0ba5 Normalize backslash on windows
  • a0eab48 Merge pull request #8667 from webpack/bugfix/esModule-flag
  • 42007e8 fixes #8666

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semantic-release is breaking the build 🚨

The devDependency semantic-release was updated from 15.13.32 to 15.14.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v15.14.0

15.14.0 (2019-12-21)

Features

  • pass envi-ci values to plugins context (a8c747d)
Commits

The new version differs by 2 commits.

  • a8c747d feat: pass envi-ci values to plugins context
  • fc70726 chore: add Mockserver generated file to gitignore

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Get the download URL for a workflow artifact instead of following the redirect and downloading it

Is it possible to get the download URL for an artifact?
The docs here suggest that the 302 redirect URL will be returned from a call like this:

let response = await octokit.request('GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}', {
  owner: 'octocat',
  repo: 'hello-world',
  artifact_id: 42,
  archive_format: 'archive_format'
})

When I am trying that (as well as octokit.actions.downloadArtifact, as per these docs), it seems that the 302 redirect is followed, making my response look like so:

{
  status: 200,
  url: 'https://pipelines.actions...', // <-- this is the correct, signed URL, that I want
  headers: { ... },
  data: ArrayBuffer(23750288) // <-- Downloads the artifact into `data`. I don't want it to do this
}

I want to just get that url, without downloading the response into that data ArrayBuffer.
Is that possible? I've tried adding request: { redirect: 'manual'} as an option, but that didn't seem to do it.

An in-range update of @octokit/endpoint is breaking the build 🚨

The dependency @octokit/endpoint was updated from 4.2.2 to 4.3.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@octokit/endpoint is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v4.3.0

4.3.0 (2019-05-01)

Bug Fixes

  • typescript: accept and user-agent header are always set for Defaults type (9bfa534)
  • typescript: accept and user-agent header are always set for Defaults type (460151c)
  • typescript: adapt types for deprecated .merge() usage (de378f0)

Features

  • typescript: add types for options/result for "GET /" root request (ea483b1)
FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @octokit/endpoint is breaking the build 🚨

The dependency @octokit/endpoint was updated from 3.2.1 to 3.2.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@octokit/endpoint is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • coverage/coveralls: First build on greenkeeper/@octokit/endpoint-3.2.2 at 100.0% (Details).

Release Notes for v3.2.2

3.2.2 (2019-03-13)

Bug Fixes

  • options.mediaType.format + options.mediaType.previews + accept header (7794d15)
Commits

The new version differs by 4 commits.

  • 7794d15 fix: options.mediaType.format + options.mediaType.previews + accept header
  • fcf4d5a test: options.mediaType.format + options.mediaType.previews + accept header
  • 1a4972b lib: don’t alter options.headers in endpoint.parse()
  • da4d4e6 test: don’t alter options.headers in endpoint.parse()

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.