Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#2,285 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
github-actions
领域
ci-cd

调研方向

从 issue 中显示的 workflow 和 CodeQL 的 upload-sarif 步骤开始;将报告中缺失的 eslint-results.sarif 路径与前面的 ESLint 命令进行比较。当 workflow 生成该 SARIF 文件且上传步骤在没有路径错误的情况下完成时,即可完成。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
TypeScript
星标
1.6k
派生
493
平均合并
1 天 13 小时
30 天内合并 PR
44

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/codeql-action 的其他 Issue

查看 github/codeql-action 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。