Skip to content

Commit 9abf6a1

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/cache-5
2 parents 80081e8 + 7fea0a2 commit 9abf6a1

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,40 @@ jobs:
2929
- name: Checkout repository
3030
uses: actions/checkout@v4
3131

32+
- name: Check for C# sources
33+
id: csharp_sources
34+
shell: bash
35+
run: |
36+
if git ls-files '*.cs' '*.csproj' | grep -q .; then
37+
echo "present=true" >> "$GITHUB_OUTPUT"
38+
else
39+
echo "present=false" >> "$GITHUB_OUTPUT"
40+
echo "No C# sources found; skipping CodeQL C# analysis."
41+
fi
42+
3243
- name: Setup .NET (from global.json)
44+
if: steps.csharp_sources.outputs.present == 'true'
3345
uses: actions/setup-dotnet@v4
3446
with:
3547
global-json-file: global.json
3648

3749
- name: Initialize CodeQL
50+
if: steps.csharp_sources.outputs.present == 'true'
3851
uses: github/codeql-action/init@v3
3952
with:
4053
languages: ${{ matrix.language }}
4154
build-mode: ${{ matrix.build-mode }}
4255

4356
- name: Restore dependencies
57+
if: steps.csharp_sources.outputs.present == 'true'
4458
run: dotnet restore ARCP.slnx
4559

4660
- name: Build
61+
if: steps.csharp_sources.outputs.present == 'true'
4762
run: dotnet build ARCP.slnx --configuration Release --no-restore
4863

4964
- name: Perform CodeQL Analysis
65+
if: steps.csharp_sources.outputs.present == 'true'
5066
uses: github/codeql-action/analyze@v3
5167
with:
5268
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)