From f3b92a259f7271ab789baee4731e5499b18c5eeb Mon Sep 17 00:00:00 2001 From: LeShadow Date: Thu, 17 Oct 2024 02:23:15 +0200 Subject: [PATCH 1/2] Add swift to list of supported languages --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index f75ac7d..7696c99 100644 --- a/main.py +++ b/main.py @@ -6,7 +6,7 @@ token = sys.argv[1] endpoint = sys.argv[2] exclude = sys.argv[3] -codeql_languages = ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "typescript", "kotlin"] +codeql_languages = ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "typescript", "kotlin", "swift"] # Connect to the languages API and return languages From 24258575f0171e88df83fa436e1dcbfdd780a6e2 Mon Sep 17 00:00:00 2001 From: LeShadow Date: Thu, 17 Oct 2024 03:03:16 +0200 Subject: [PATCH 2/2] Update README.md with an example for swift --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index f894cbd..facc213 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,27 @@ Example: ``` +### 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. + +Example: +``` yaml + analyze: + needs: create-matrix + if: ${{ needs.create-matrix.outputs.matrix != '[]' }} + name: Analyze + runs-on: ${{ matrix.language == 'swift' && 'macos-latest' || 'ubuntu-latest' }} + permissions: + actions: read + contents: read + security-events: write +``` + +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: +``` yaml + runs-on: ${{ matrix.language == 'swift' && 'macos-latest' || fromJSON('{"group":"runner-group-name"}') }} +``` + ## License This project is licensed under the terms of the MIT open source license. Please refer to [MIT](./LICENSE.md) for the full terms.