Skip to content

Commit 245a56d

Browse files
authored
feature: Add swift to list of supported languages (#9)
1 parent 00ba870 commit 245a56d

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,27 @@ Example:
9494
9595
```
9696

97+
### Swift support
98+
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.
99+
100+
Example:
101+
``` yaml
102+
analyze:
103+
needs: create-matrix
104+
if: ${{ needs.create-matrix.outputs.matrix != '[]' }}
105+
name: Analyze
106+
runs-on: ${{ matrix.language == 'swift' && 'macos-latest' || 'ubuntu-latest' }}
107+
permissions:
108+
actions: read
109+
contents: read
110+
security-events: write
111+
```
112+
113+
If you want to run all languages **other than Swift** on a specific group of runners, you can adjust the `runs-on` line in your workflow as shown in the following example:
114+
``` yaml
115+
runs-on: ${{ matrix.language == 'swift' && 'macos-latest' || fromJSON('{"group":"runner-group-name"}') }}
116+
```
117+
97118
## License
98119

99120
This project is licensed under the terms of the MIT open source license. Please refer to [MIT](./LICENSE.md) for the full terms.

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
token = sys.argv[1]
77
endpoint = sys.argv[2]
88
exclude = sys.argv[3]
9-
codeql_languages = ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "typescript", "kotlin"]
9+
codeql_languages = ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "typescript", "kotlin", "swift"]
1010

1111

1212
# Connect to the languages API and return languages

0 commit comments

Comments
 (0)