diff --git a/.changeset/tough-rats-sip.md b/.changeset/tough-rats-sip.md new file mode 100644 index 000000000..9c1b9f063 --- /dev/null +++ b/.changeset/tough-rats-sip.md @@ -0,0 +1,6 @@ +--- +"@changesets/get-github-info": patch +"@changesets/changelog-github": patch +--- + +Errors resulting from the GitHub API calls should now be properly raised. diff --git a/packages/get-github-info/src/index.ts b/packages/get-github-info/src/index.ts index 0e919e43b..822e77a43 100644 --- a/packages/get-github-info/src/index.ts +++ b/packages/get-github-info/src/index.ts @@ -58,7 +58,7 @@ function makeQuery(repos: ReposWithCommitsAndPRsToFetch) { mergeCommit { commitUrl abbreviatedOid - } + } }` ) .join("\n")} @@ -100,6 +100,16 @@ const GHDataLoader = new DataLoader(async (requests: RequestData[]) => { body: JSON.stringify({ query: makeQuery(repos) }) }).then((x: any) => x.json()); + if (data.errors) { + throw new Error( + `An error occurred when fetching data from GitHub\n${JSON.stringify( + data.errors, + null, + 2 + )}` + ); + } + // this is mainly for the case where there's an authentication problem if (!data.data) { throw new Error(