File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : C# Linter
2+
3+ on :
4+ workflow_dispatch : # Allows manual execution via GitHub CLI
5+
6+ jobs :
7+ lint :
8+ runs-on : ubuntu-latest
9+
10+ steps :
11+ - name : Checkout repository
12+ uses : actions/checkout@v4
13+
14+ - name : Setup .NET
15+ uses : actions/setup-dotnet@v3
16+ with :
17+ dotnet-version : 8.0.x # Adjust as needed
18+
19+ - name : Find C# files in target directories (excluding EOS_SDK)
20+ id : find-files
21+ run : |
22+ CS_FILES=$(find Assets com.playeveryware.eos -type f -name "*.cs" ! -path "com.playeveryware.eos/Runtime/EOS_SDK/*" | tr '\n' ' ')
23+ echo "Found C# files:"
24+ echo "$CS_FILES"
25+ echo "FILES=$CS_FILES" >> $GITHUB_ENV
26+
27+ - name : Run Roslyn Analyzers on Selected C# Files
28+ if : env.FILES != ''
29+ continue-on-error : true # Allow warnings but don’t fail the workflow
30+ run : |
31+ for file in $FILES; do
32+ echo "Analyzing $file"
33+ dotnet build --no-restore /warnaserror- /p:AnalysisLevel=latest "$file"
34+ done
35+
36+ - name : Post Warnings as PR Comments
37+ if : env.FILES != ''
38+ uses : mshick/add-pr-comment@v2
39+ with :
40+ message : " ⚠️ Code analysis found warnings in this PR. While these are not blocking, consider addressing them for better code quality. 🚀"
You can’t perform that action at this time.
0 commit comments