From b360d50809ed2a0e28f3fc482c242776f44b5851 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Thu, 15 Dec 2022 18:08:54 +0100 Subject: [PATCH] Improve the error message for a missing `GITHUB_TOKEN` to include the information about the required permissions (#1035) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * specify token permissions in the error message * Create tricky-months-whisper.md * Update .changeset/tricky-months-whisper.md * Update packages/get-github-info/src/index.ts Co-authored-by: Mateusz BurzyƄski --- .changeset/tricky-months-whisper.md | 5 +++++ packages/get-github-info/src/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tricky-months-whisper.md diff --git a/.changeset/tricky-months-whisper.md b/.changeset/tricky-months-whisper.md new file mode 100644 index 000000000..e789e549a --- /dev/null +++ b/.changeset/tricky-months-whisper.md @@ -0,0 +1,5 @@ +--- +"@changesets/get-github-info": patch +--- + +Improved the error message for a missing `GITHUB_TOKEN` to include the information about the required permissions. diff --git a/packages/get-github-info/src/index.ts b/packages/get-github-info/src/index.ts index ba40745c3..2378f369c 100644 --- a/packages/get-github-info/src/index.ts +++ b/packages/get-github-info/src/index.ts @@ -81,7 +81,7 @@ function makeQuery(repos: ReposWithCommitsAndPRsToFetch) { const GHDataLoader = new DataLoader(async (requests: RequestData[]) => { if (!process.env.GITHUB_TOKEN) { throw new Error( - "Please create a GitHub personal access token at https://github.com/settings/tokens/new and add it as the GITHUB_TOKEN environment variable" + "Please create a GitHub personal access token at https://github.com/settings/tokens/new with `read:user` and `repo:status` permissions and add it as the GITHUB_TOKEN environment variable" ); } let repos: ReposWithCommitsAndPRsToFetch = {};