guibranco / CrispyWaffle

🧰 🛠️ Crispy Waffle project - toolkit for .NET projects
https://guibranco.github.io/CrispyWaffle/
MIT License
24 stars 19 forks source link

[FEATURE] Add InferSharp workflow #617

Open guibranco opened 2 hours ago

guibranco commented 2 hours ago

Implement a new GitHub Actions workflow to integrate InferSharp into this repository. This will enable static analysis to detect null dereference issues and improve code quality.

Workflow Details

The workflow should:

Reference

Use the following workflow implementation as a reference: InferSharp Workflow

Workflow Code

Add the following YAML configuration as .github/workflows/infersharp.yml in the repository:

name: InferSharp
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:

  infer:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Infer#
        uses: microsoft/infersharpaction@v1.5
        id: runinfersharp

      - name: Upload SARIF output to GitHub Security Center
        uses: github/codeql-action/upload-sarif@v2
        if: success() && hashFiles('infer-out/report.sarif') != ''
        with:
          sarif_file: infer-out/report.sarif
        continue-on-error: true

Acceptance Criteria

  1. The .github/workflows/infersharp.yml file is added to each C# repository.
  2. The workflow triggers correctly on push and pull_request events to the main branch.
  3. InferSharp successfully analyzes the code and generates a SARIF report.
  4. SARIF output is uploaded to the GitHub Security Center.
gitauto-ai[bot] commented 2 hours ago

Click the checkbox below to generate a PR!

@guibranco, You have 3 requests left in this cycle which refreshes on 2024-12-21 10:07:38+00:00. If you have any questions or concerns, please contact us at info@gitauto.ai.