Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ Example:

```

### Actions support

The GitHub API for [List repository languages](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repository-languages) does not by default include "YAML"/"GitHub Actions". This is particularly useful if your repository contains GitHub Actions workflows that you want to include in CodeQL analysis.

To add support for this to your repo, you must add a `.gitattributes` file with the following contents:

```
.github/workflows/*.yml linguist-detectable -linguist-vendored
.github/workflows/*.yaml linguist-detectable -linguist-vendored
```

These directives tell GitHub's linguist to detect YAML files in the `.github/workflows/` directory as a language and not treat them as vendored code, making them visible in the repository languages API.

### Swift support
If you want to include Swift in your CodeQL analysis, you need to ensure that the action runs on a macOS runner. This is because Swift analysis with CodeQL requires a macOS environment. You can achieve this by making the `runs-on` field in your workflow conditional based on the language being analyzed.

Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def build_languages_list(languages):
languages[i] = ("javascript")
if languages[i] == "kotlin":
languages[i] = ("java")
# GitHub Actions
if languages[i] == "yaml":
languages[i] = ("actions")

print("After mapping:", languages)
Comment thread
felickz marked this conversation as resolved.
intersection = list(set(languages) & set(codeql_languages))
print("Intersection:", intersection)
return intersection

# return a list of objects from language list if they are not in the exclude list
Expand Down