diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..438dabe --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: nuget + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 5 + + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 5 + + - package-ecosystem: docker + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbd5957..5116452 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,11 +6,10 @@ on: pull_request: branches: [main] -permissions: - contents: read - jobs: build-and-test: + permissions: + contents: read runs-on: ubuntu-latest timeout-minutes: 15 @@ -32,9 +31,14 @@ jobs: - name: Test run: dotnet test CargoAPI.Tests/CargoAPI.Tests.csproj --configuration Release --no-build --verbosity normal + - name: Create ephemeral SQL Server password for compose validation + shell: bash + run: | + password="Aa1!$(openssl rand -hex 24)" + echo "::add-mask::$password" + echo "MSSQL_SA_PASSWORD=$password" >> "$GITHUB_ENV" + - name: Validate Docker Compose configuration - env: - MSSQL_SA_PASSWORD: CI_Only_Password_2026! run: docker compose config --quiet - name: Build API container image diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..54b65fa --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,40 @@ +name: CodeQL + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: "29 4 * * 3" + +jobs: + analyze: + name: Analyze C# + permissions: + contents: read + security-events: write + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET 10 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: csharp + queries: security-extended + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:csharp"