github / github/codeql

CodeQL detected code written in `some language`, but not any written in GitHub Actions. Confirm that there is some source code for GitHub Actions in the project.

未关闭
#20,102 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

While investigating another problem involving CodeQL, I switched from the default setup to the advanced setup. This resulted in the creation of a [`.github/workflows/codeql.yml`](https://github.com/user-attachments/files/21353129/codeql.yml.txt).

Later, I switched back to the default setup, but found it impossible to push a commit that removed the `codeql.yml` because

> Error: Encountered a fatal error while running "/opt/hostedtoolcache/CodeQL/2.22.1/x64/codeql/codeql database finalize --finalize-dataset --threads=8 --ram=29878 /home/runner/work/_temp/codeql_databases/actions". Exit code was 32 and last log line was: CodeQL detected code written in JavaScript/TypeScript, but not any written in GitHub Actions. Confirm that there is some source code for GitHub Actions in the project. For more information, review our troubleshooting guide at https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build . See the logs for more details.

Look, I don't want to confirm that there is some source code for GitHub Actions. I want to reassure CodeQL that there is no source code for GitHub Actions and everything is A-OK. Based on the troubleshooting guide, I set `strategy.matrix.language` to `['javascript-typescript']`, but of course this had no effect because CodeQL was now operating in default mode and ignoring the configuration.

Switching back to advanced mode should work, right? Nope, it tried to create another `codeql.yml`, and that failed because

> There was an error committing your changes: A file with the same name already exists. Please choose a different name and try again.

Now CodeQL is not working at all, so there's no way to merge anything into the main branch.

What's the right way to remove `codeql.yml` and reset CodeQL to default mode? How would one rescue this seemingly broken CodeQL setup?

贡献指南

打开贡献指南

调研方向

Start with the attached .github/workflows/codeql.yml and compare it with the repository's current default and advanced CodeQL setup. Read the linked CodeQL troubleshooting guide and inspect the workflow logs to understand why the actions database is still finalized. Done means CodeQL is restored to the intended setup and the main branch can merge without this failure.

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

评估

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

把新 issue 发到你的邮箱

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