CodeQL Action Fails to Find eslint-results.sarif: Path Does Not Exist Error

Open
#2,285 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
github-actions
Domain
ci-cd

Research direction

Start with the workflow shown in the issue and the CodeQL upload-sarif step; compare the reported missing eslint-results.sarif path with the preceding ESLint command. Done when the workflow produces that SARIF file and the upload step completes without the path error.

Written by the indexing model from the issue text.

Description

Always getting the follow error when running the default CodeQL upload action, seen this has been raised before but no solution found.

Warning: CodeQL Action v2 will be deprecated on December 5th, 2024. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/
Error: Path does not exist: eslint-results.sarif
ConfigurationError: Path does not exist: eslint-results.sarif
    at getSarifFilePaths (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-lib.js:2[9](https://github.com/********/********/actions/runs/9045918875/job/24867198772?pr=11#step:5:10)0:15)
    at Object.uploadFromActions (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-lib.js:284:30)
    at run (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-sarif-action.js:56:47)
    at async runWrapper (/home/runner/work/_actions/github/codeql-action/v2/lib/upload-sarif-action.js:84:9)

Action:

name: ESLint

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
  schedule:
    - cron: '38 15 * * 3'

jobs:
  eslint:
    name: Run eslint scanning
    runs-on: ubuntu-latest
    permissions:
      contents: read
      security-events: write
      actions: read
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install ESLint
        run: |
          npm install eslint@8.10.0
          npm install @microsoft/eslint-formatter-sarif@2.1.7

      - name: Run ESLint
        run: npx eslint .
          --config .eslintrc.js
          --ext .js,.jsx,.ts,.tsx
          --format @microsoft/eslint-formatter-sarif
          --output-file eslint-results.sarif
        continue-on-error: true

      - name: Upload analysis results to GitHub
        uses: github/codeql-action/upload-sarif@v2
        with:
          sarif_file: eslint-results.sarif
          token: ${{ secrets.GITHUB_TOKEN }}
          wait-for-processing: true
Dominant language
TypeScript
Stars
1.6k
Forks
493
Avg merge
1d 13h
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-action

All issues in github/codeql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.