diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 145a333..7188255 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@01aecccf739ca6ff86c0539fbc67a7a5007bbc81 - uses: actions/setup-node@83c9f7a7df54d6b57455f7c57ac414f2ae5fb8de with: - node-version: 12 + node-version: 14 - uses: actions/cache@70655ec8323daeeaa7ef06d7c56e1b9191396cbe id: cache diff --git a/package.json b/package.json index 579a782..5ae1055 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { "babel-eslint": "10.1.0", - "eslint": "7.10.0", + "eslint": "7.11.0", "eslint-config-airbnb-base": "14.2.0", "eslint-config-prettier": "6.12.0", "eslint-plugin-import": "2.22.1", diff --git a/pull_request.js b/pull_request.js index ba38df7..3ac08a2 100644 --- a/pull_request.js +++ b/pull_request.js @@ -154,6 +154,7 @@ async function main() { duplicates: '', other_links_error: '', github_repos: '', + query: '', }; const markdown = await fs.readFile(README, 'utf8'); let links = extract_all_links(markdown); @@ -192,16 +193,18 @@ async function main() { const repos = extract_repos(github_links); const query = generate_GQL_query(repos); const options = make_GQL_options(query); - const gql_response = await fetch(GITHUB_GQL_API, options).then((r) => - r.json(), - ); + const gql_response = await fetch(GITHUB_GQL_API, options) + .then((r) => r.json()) + .catch((err) => console.error(err)); + if (gql_response.errors) { has_error.show = true; has_error.github_repos = gql_response.errors; + has_error.query = query; } console.log({ - TEST_PASSED: has_error.show, + TEST_PASSED: !has_error.show, GITHUB_REPOSITORY: github_links.length, EXTERNAL_LINKS: external_links.length, });