Skip to content

Commit b360d50

Browse files
KikobeatsAndarist
andauthored
Improve the error message for a missing GITHUB_TOKEN to include the 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 <[email protected]>
1 parent c606dc6 commit b360d50

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@changesets/get-github-info": patch
3+
---
4+
5+
Improved the error message for a missing `GITHUB_TOKEN` to include the information about the required permissions.

packages/get-github-info/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function makeQuery(repos: ReposWithCommitsAndPRsToFetch) {
8181
const GHDataLoader = new DataLoader(async (requests: RequestData[]) => {
8282
if (!process.env.GITHUB_TOKEN) {
8383
throw new Error(
84-
"Please create a GitHub personal access token at https://github.com/settings/tokens/new and add it as the GITHUB_TOKEN environment variable"
84+
"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"
8585
);
8686
}
8787
let repos: ReposWithCommitsAndPRsToFetch = {};

0 commit comments

Comments
 (0)