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

`getNoLanguagesError` / Did not detect any languages to analyze. Please update input in workflow or check that GitHub detects the correct languages in your repository.

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

还没有人认领这个 Issue。

评估

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

调研方向

从 CodeQL workflow 以及 runs 7839464145、7840155320 和 7840157412 中链接的 github/codeql-action/init 日志开始;将语言检测与不同的 fork 权限进行比较。完成的标准是,no-language 和权限相关的失败能够清楚地解释其原因,并将用户引导至相关的 workflow 或文档指南。

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

描述

I created two forks of https://github.com/octokit/request.js:

  1. https://github.com/jsoref/request.js
  2. https://github.com/check-spelling-sandbox/request.js

both were created at approximately the same time.

Every single run of the codeql workflow in my repository has ❌ failed.

The first three runs ❌ failed in check-spelling-sandbox, but after giving it security-events: write, it would occasionally
✅ succeed -- and it never yielded the output below.

I'm quite confused by the behavior and output of https://github.com/jsoref/request.js/actions/runs/7839464145

To some extent, the commits in my fork are just copies of the commits in the sandbox fork...

Annotations

1 error and 1 warning
CodeQL-Build
Did not detect any languages to analyze. Please update input in workflow or check that GitHub detects the correct languages in your repository.
CodeQL-Build
Debugging artifacts are unavailable since the 'init' Action failed before it could produce any.

https://github.com/jsoref/request.js/actions/runs/7839464145/job/21392525353

Run github/codeql-action/init@v3
Setup CodeQL tools
Validating workflow
Load language configuration
  /opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/codeql resolve languages --format=json
  {
    "xml" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/xml"
    ],
    "javascript" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/javascript"
    ],
    "go" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/go"
    ],
    "python" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/python"
    ],
    "properties" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/properties"
    ],
    "ruby" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/ruby"
    ],
    "csharp" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/csharp"
    ],
    "html" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/html"
    ],
    "java" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/java"
    ],
    "yaml" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/yaml"
    ],
    "swift" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/swift"
    ],
    "cpp" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/cpp"
    ],
    "csv" : [
      "/opt/hostedtoolcache/CodeQL/2.16.1/x64/codeql/csv"
    ]
  }
  Automatically detected languages: 
  Error: Did not detect any languages to analyze. Please update input in workflow or check that GitHub detects the correct languages in your repository.
-- note that this repository is configured w/ default read&write permissions (I haven't adjusted my forking code to disable actions -- I will probably do that eventually as workflows in my personal account are too dangerous and frustrating).

By contrast, https://github.com/check-spelling-sandbox/request.js/actions/runs/7840155320 fails in a way that I understand (and am working to fix):

Annotations

2 errors and 1 warning
CodeQL-Build
Resource not accessible by integration
CodeQL-Build
Resource not accessible by integration
CodeQL-Build
Debugging artifacts are unavailable since the 'init' Action failed before it could produce any.

And https://github.com/check-spelling-sandbox/request.js/actions/runs/7840157412 passes

Annotations

2 warnings
CodeQL-Build
This run of the CodeQL Action does not have permission to access Code Scanning API endpoints. As a result, it will not be opted into any experimental features. This could be because the Action is running on a pull request from a fork. If not, please ensure the Action has the 'security-events: write' permission. Details: Resource not accessible by integration
CodeQL-Build
Feature flags do not specify a default CLI version. Falling back to the CLI version shipped with the Action. This is 2.16.1.

-- for the record, the check-spelling-sandbox org uses https://docs.github.com/en/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization to restrict permissions to read -- eventually I'll file a PR to improve the message here since it should be aware that this is a possibility.


Isn't this all the same code? Why would one of my forks complain about not being able to guess what file types are involved while another is able to?

Ideally the error reporting should be sufficiently clear that a non expert would be able to understand what to do. If the possible actions necessary to resolve the problem are sufficiently complicated, then it'd be a good idea to linking to a document that can walk users through the possibilities.

主要语言
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 摘要。