message: fix(scripts): fail gracefully when unable to resolve the GitHub API
diff: @@ -51,6 +51,8 @@ const readMarkdown = (path: string): Promise<string> =>
  const getGitHubData = async (filePath: string) => {
  const [, path] = /^.+\/(src\/pages\/.+\.md)$/.exec(filePath);
  const since = new Date('2019-01-23').toISOString();
  +
  + try {
  const request = await fetch(url.format({
  protocol: 'https',
  hostname: 'api.github.com',
  @@ -62,14 +64,6 @@ const getGitHubData = async (filePath: string) => {
  }
  }));
  - if (!request.ok) {
  - return {
  - path,
  - contributors: [],
  - lastUpdated: since
  - };
  - }
  -
  const commits = await request.json();
  const contributors = Array.from(new Set(commits.map(commit => commit.author.login)));
  const lastUpdated = commits.length ? commits[0].commit.author.date : since;
  @@ -78,4 +72,11 @@ const getGitHubData = async (filePath: string) => {
  contributors,
  lastUpdated
  };
  + } catch (error) {
  + return {
  + path,
  + contributors: [],
  + lastUpdated: since
  + };
  + }
  };
  