Skip to content

Commit

Permalink
Improve the error message for a missing GITHUB_TOKEN to include the…
Browse files Browse the repository at this point in the history
… information about the required permissions (#1035)

* 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 <mateuszburzynski@gmail.com>
  • Loading branch information
Kikobeats and Andarist committed Dec 15, 2022
1 parent c606dc6 commit b360d50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .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.
2 changes: 1 addition & 1 deletion packages/get-github-info/src/index.ts
Expand Up @@ -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 = {};
Expand Down

0 comments on commit b360d50

Please sign in to comment.