From d53f773174154507586023ced93f9c609aacbc86 Mon Sep 17 00:00:00 2001 From: Le Minh Tri Date: Thu, 12 Mar 2026 06:12:26 +0700 Subject: [PATCH] ci: add quick check workflow for feature branches --- .github/workflows/feature-check.yml | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/feature-check.yml diff --git a/.github/workflows/feature-check.yml b/.github/workflows/feature-check.yml new file mode 100644 index 0000000..067bfe1 --- /dev/null +++ b/.github/workflows/feature-check.yml @@ -0,0 +1,39 @@ +name: Feature Branch Check + +on: + push: + branches-ignore: + - main + - dev + +jobs: + quick-check: + name: Quick Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore Project-sem3-backend.sln + + - name: Check code format + run: dotnet format Project-sem3-backend.sln --verify-no-changes --verbosity diagnostic + + - name: Build + run: dotnet build Project-sem3-backend.sln --configuration Release --no-restore /p:TreatWarningsAsErrors=true + + - name: Security scan + run: | + dotnet list package --vulnerable --include-transitive 2>&1 | tee vulnerable-packages.txt + if grep -q "has the following vulnerable packages" vulnerable-packages.txt; then + echo "::error::Vulnerable packages detected!" + cat vulnerable-packages.txt + exit 1 + fi