diff --git a/CHANGELOG.md b/CHANGELOG.md index 14ec287b01..1ed8fb3e42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa - Fixes PnP detection with workspaces (`installConfig` is now read at the top-level) [#6878](https://github.com/yarnpkg/yarn/pull/6878) - [**Maƫl Nison**](https://twitter.com/arcanis) + +- Adds support for `GITHUB_TOKEN` in `yarn policies set-version` + + [#6912](https://github.com/yarnpkg/yarn/pull/6912) - [**Billy Vong**](https://github.com/billyvg) ## 1.13.0 diff --git a/src/cli/commands/policies.js b/src/cli/commands/policies.js index 595f42b5aa..4bd1fb6b5a 100644 --- a/src/cli/commands/policies.js +++ b/src/cli/commands/policies.js @@ -47,8 +47,10 @@ async function fetchReleases( config: Config, {includePrereleases = false}: FetchReleasesOptions = {}, ): Promise> { + const token = process.env.GITHUB_TOKEN; + const tokenUrlParameter = token ? `?access_token=${token}` : ''; const request: Array = await config.requestManager.request({ - url: `https://api.github.com/repos/yarnpkg/yarn/releases`, + url: `https://api.github.com/repos/yarnpkg/yarn/releases${tokenUrlParameter}`, json: true, });