From 435d28fdc32b672a53ab0e12cc19e4ca7c22dcea Mon Sep 17 00:00:00 2001 From: Stuart Meeks Date: Thu, 15 Oct 2026 08:57:56 +0000 Subject: [PATCH] ci: add Dependabot version updates and CodeQL code scanning Snipdeck had no dependency or code-scanning coverage, unlike the other .NET repos. Both files are modelled on NextIteration.Standards, adapted for an app: no per-TFM floor ignores (there are no floors to protect), and CodeQL runs buildless because Snipdeck.App needs the Windows App SDK to compile, which an ubuntu runner lacks. The two P/Invoke audit queries are excluded because WindowsHotkeyService calls user32 deliberately. Dependabot alerts, security updates and secret scanning with push protection were enabled in the repository settings alongside this. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 57 +++++++++++++++++++++++++++++ .github/workflows/codeql.yml | 70 ++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/codeql.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e9fa763 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,57 @@ +version: 2 + +updates: + # --------------------------------------------------------------------------- + # NuGet packages (src + tests) + # + # Minor and patch bumps are grouped into a single PR. Major bumps are + # deliberately left OUT of the group, so each arrives as its own PR for + # manual review. Adapted from NextIteration.Standards (no auto-merge here). + # --------------------------------------------------------------------------- + - package-ecosystem: nuget + directory: "/" + schedule: + interval: weekly + day: monday + time: "06:00" + timezone: Etc/UTC + open-pull-requests-limit: 10 + commit-message: + prefix: "chore(deps)" + labels: + - dependencies + - nuget + # No ignore block: the per-TFM floor ignores in the Standards template are for + # multi-targeted libraries. Snipdeck is an app with no floors to protect. + groups: + nuget-minor-patch: + patterns: + - "*" + update-types: + - minor + - patch + + # --------------------------------------------------------------------------- + # GitHub Actions used by ci.yml, release.yml and codeql.yml. Same grouping + # rule as NuGet. + # --------------------------------------------------------------------------- + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + day: monday + time: "06:00" + timezone: Etc/UTC + open-pull-requests-limit: 10 + commit-message: + prefix: "chore(actions)" + labels: + - dependencies + - github-actions + groups: + actions-minor-patch: + patterns: + - "*" + update-types: + - minor + - patch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..4a3543d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,70 @@ +# CodeQL code scanning. Modelled on NextIteration.Standards' codeql.yml. +name: CodeQL + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + # Weekly, so a newly published query pack finds existing code even when + # nothing has been pushed. Offset off the hour to avoid the scheduling spike. + - cron: '37 4 * * 1' + +concurrency: + group: codeql-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + analyze: + name: analyze + runs-on: ubuntu-latest + timeout-minutes: 30 + + permissions: + security-events: write # required to upload results + contents: read + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: csharp + # build-mode: none analyses the C# source directly, without a build. + # Snipdeck.App targets net10.0-windows and needs the Windows App SDK + # to compile, which an ubuntu runner can't do; buildless extraction + # still reads its source alongside Core, Execution and the tools. + # It is also the only mode in which paths-ignore (below) applies. + build-mode: none + # security-and-quality is broader than the default security-extended; + # the codebase is small, so the extra findings are affordable. + queries: security-and-quality + # Analyse source only. obj/ and bin/ hold generated and compiled + # output (e.g. the xUnit auto-generated entry point and XAML + # code-behind), so findings there are noise against code no human + # maintains. + # + # query-filters excludes the two audit queries that fire on every + # P/Invoke declaration and call site. WindowsHotkeyService calls + # user32 on purpose, so these are pure noise; every other query still + # runs on that file. + config: | + paths-ignore: + - "**/obj/**" + - "**/bin/**" + query-filters: + - exclude: + id: cs/unmanaged-code + - exclude: + id: cs/call-to-unmanaged-code + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:csharp"