ataylorme / eslint-annotate-action

A GitHub action that takes ESLint results from a JSON file and adds them as annotated pull request comments
MIT License
88 stars 32 forks source link

404 HttpError #81

Open Designibl-Mark opened 1 month ago

Designibl-Mark commented 1 month ago

This Github action is fantastic, and runs perfectly on one of my actions in a turbo repo but receives the following for the other:

Step used:

      - name: Annotate Code Linting Results
        uses: ataylorme/eslint-annotate-action@v3
        with:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
          report-json: 'apps/email-interface/eslint_report.json'
          markdown-report-on-step-summary: true
          fail-on-warning: true

Partial output of eslint:

 1 problem (0 errors, 1 warning)

Output of step:

Starting analysis of the ESLint report src/__***s__/eslintReport-3-errors.json. Standby...
/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:26478
      const error = new import_request_error.RequestError(toErrorMessage(data), status, {
                    ^

RequestError [HttpError]: Not Found
    at /home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:26478:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.next (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:26653:28)
    at async getPullRequestFiles (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56503:25)
    at async getPullRequestChangedAnalyzedReport (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56444:26)
    at async run (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56561:11) {
  status: 404,
  response: {
    url: 'https://api.github.com/repos/ataylorme/eslint-annotate-github-action/pulls/455/files',
    status: 404,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
      'content-encoding': 'gzip',
      'content-length': '115',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Mon, 03 Jun 2024 13:57:38 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'GitHub.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-api-version-selected': '2022-11-28',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': 'B008:18256B:6865E74:B2392F9:665DCBD2',
      'x-ratelimit-limit': '60',
      'x-ratelimit-remaining': '59',
      'x-ratelimit-reset': '1717[42](https://github.com/Spot-Ship/Mono-Frontend/actions/runs/9351117744/job/25737456384#step:9:43)6658',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '1',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Not Found',
      documentation_url: 'https://docs.github.com/rest/pulls/pulls#list-pull-requests-files'
    }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/ataylorme/eslint-annotate-github-action/pulls/[45](https://github.com/Spot-Ship/Mono-Frontend/actions/runs/9351117744/job/25737456384#step:9:46)5/files',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-action.js/6.0.7 octokit-core.js/5.1.0 Node.js/20.8.1 (linux; x64)'
    },
    request: {
      fetch: [AsyncFunction: customFetch],
      hook: [Function: bound bound register]
    }
  }
}

Node.js v20.8.1