How are repository languages identified

Question

The pull request introduced in my repository contains one or more languages that are not used in my repository. How did you identify the languages in my repository?

Answer

On every push to GitHub, a background process is triggered that identifies the languages that exist in your repository. As part of the enablement process, the GitHub Languages API is used to identify the languages in your repository. This data is also exposed via the GitHub UI by navigating to the root of your repository and scrolling to the bottom of panel on the right side of the page. GitHub will display any language that makes up more than 1% of the total content of your repository, while remaining languages are grouped into an “Other” category.

To view the languages grouped in the “Other” category, you may use the GitHub Languages API.

Several languages have their support provided by other language packs when using CodeQL. The following table shows the languages that are mapped to other language packs:

Language Mapped to CodeQL Language Pack
C C++ cpp
TypeScript JavaScript javascript
Kotlin Java java

For the above languages you must map the language to the appropriate CodeQL language pack in your codeql-analysis.yml in the language matrix if you are using GitHub Action. For example, if your repository contains TypeScript, you must add javascript to the language matrix in your codeql-analysis.yml file. For Jenkins, you must use the key in the CodeQL Language Pack column in when you call the ExecuteCodeQL function in your Jenkins pipeline.

References