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

Cannot read properties of undefined #82

Open thefrosty opened 1 month ago

thefrosty commented 1 month ago

Using:

on:
  pull_request:

      - name: Annotate Code Linting Results
        uses: ataylorme/eslint-annotate-action@v3
        if: ${{ always() && steps.eslint.outcome == 'failure' }}
        with:
          report-json: 'standard_report.json'
          markdown-report-on-step-summary: ${{ true }}
Starting analysis of the ESLint report standard_report.json. Standby...
/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56451
        file.filePath = file.filePath.replace(GITHUB_WORKSPACE + '/', '');
                                      ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at /home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56451:39
    at Array.filter (<anonymous>)
    at getPullRequestChangedAnalyzedReport (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56450:47)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async run (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56561:11)