Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Add workflow, repository and dependency analysis

zizmor audits the workflows themselves for what makes a workflow
unsafe, and uploads what it finds to code scanning. Its first run here
found one thing, 11 times: a checkout that leaves the job's token in
the checked-out repository, where any later step can read it. No
workflow pushes or needs the token after the checkout, so every checkout
now sets persist-credentials to false, and zizmor reports nothing.

OpenSSF Scorecard grades how the repository is kept: branch protection,
pinned dependencies, token permissions and the like. It runs on the
default branch and weekly and uploads its findings to
code scanning.

Dependency Review fails a pull request that adds or changes a dependency
with a known vulnerability of high severity or worse. Dependabot watches
what is already there; this holds what comes in.

Every new action is pinned to a commit, each job names the permissions
it needs, and no new workflow has a default permission.

Two steps of the Windows build ran in the CMD shell, which zizmor cannot

read into; they run in PowerShell now, with the same commands and the

processor count taken from the environment.
Commit
ba6cbc4e6fc71f7b2240f9c42f1124dc2e9b6532
Author
Leitwolf11 ·
Parents
00bd15ded1dd

Files · Download .tar.gz

Changes

 .github/workflows/alternative-build-systems.yml |  4 ++
 .github/workflows/bazel-builds.yml              |  2 +
 .github/workflows/codeql.yml                    |  2 +
 .github/workflows/coverage.yml                  |  2 +
 .github/workflows/dependency-review.yml         | 34 ++++++++++++++++
 .github/workflows/mac-builds.yml                |  2 +
 .github/workflows/mac-sanitizer-builds.yml      |  2 +
 .github/workflows/meson-builds.yml              |  2 +
 .github/workflows/package-manager-builds.yaml   |  2 +
 .github/workflows/scorecard.yml                 | 52 +++++++++++++++++++++++++
 .github/workflows/validate-header-guards.yml    |  2 +
 .github/workflows/windows-simple-builds.yml     | 10 +++--
 .github/workflows/zizmor.yml                    | 38 ++++++++++++++++++
 13 files changed, 150 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/alternative-build-systems.yml b/.github/workflows/alternative-build-systems.yml
index 30e59847..e5e4338f 100644
--- a/.github/workflows/alternative-build-systems.yml
+++ b/.github/workflows/alternative-build-systems.yml
@@ -16,6 +16,8 @@ jobs:
 
     steps:
       - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+        with:
+          persist-credentials: false
 
       - uses: xmake-io/github-action-setup-xmake@3a1a5dddfc7fa625d9a698738334bf55655a861a # v1
         with:
@@ -40,6 +42,8 @@ jobs:
 
     steps:
       - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+        with:
+          persist-credentials: false
 
       - uses: abel0b/setup-premake@b80dc6f70e8ab159fb854bdadbeb1a53cfc28723 # v2.4
         with:
diff --git a/.github/workflows/bazel-builds.yml b/.github/workflows/bazel-builds.yml
index 459c4db0..5f3b31c7 100644
--- a/.github/workflows/bazel-builds.yml
+++ b/.github/workflows/bazel-builds.yml
@@ -19,6 +19,8 @@ jobs:
 
     steps:
       - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+        with:
+          persist-credentials: false
 
       - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0
         with:
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 223f5eee..a0684b67 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -21,6 +21,8 @@ jobs:
         language: [actions, c-cpp]
     steps:
       - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+        with:
+          persist-credentials: false
       - uses: github/codeql-action/init@7999b86c43a865dc79d8923397f35af22de63401 # v4
         with:
           languages: ${{ matrix.language }}
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index b1f72428..eff8d70a 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -20,6 +20,8 @@ jobs:
       contents: read
     steps:
       - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+        with:
+          persist-credentials: false
       - name: Configure Clang coverage build
         run: >-
           cmake --preset basic-tests -G Ninja
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
new file mode 100644
index 00000000..83ac0c55
--- /dev/null
+++ b/.github/workflows/dependency-review.yml
@@ -0,0 +1,34 @@
+# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
+
+name: Dependency Review
+
+# Looks at the dependencies a pull request adds or changes, and fails when
+# one of them has a known vulnerability of high severity or worse.
+# Dependabot watches what is already there; this holds what comes in.
+
+on:
+  pull_request:
+
+permissions: {}
+
+concurrency:
+  group: dependency-review-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  review:
+    name: Dependency review
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    permissions:
+      contents: read
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+        with:
+          persist-credentials: false
+
+      - name: Review the dependency changes
+        uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
+        with:
+          fail-on-severity: high
diff --git a/.github/workflows/mac-builds.yml b/.github/workflows/mac-builds.yml
index d3e9e906..7ba8dac5 100644
--- a/.github/workflows/mac-builds.yml
+++ b/.github/workflows/mac-builds.yml
@@ -21,6 +21,8 @@ jobs:
 
     steps:
     - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+      with:
+        persist-credentials: false
 
     - name: Configure
       run: |
diff --git a/.github/workflows/mac-sanitizer-builds.yml b/.github/workflows/mac-sanitizer-builds.yml
index 953d0cf7..a0265c5d 100644
--- a/.github/workflows/mac-sanitizer-builds.yml
+++ b/.github/workflows/mac-sanitizer-builds.yml
@@ -29,6 +29,8 @@ jobs:
 
     steps:
     - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+      with:
+        persist-credentials: false
 
     - name: Configure with the selected sanitizers
       env:
diff --git a/.github/workflows/meson-builds.yml b/.github/workflows/meson-builds.yml
index bf116da3..456f3205 100644
--- a/.github/workflows/meson-builds.yml
+++ b/.github/workflows/meson-builds.yml
@@ -16,6 +16,8 @@ jobs:
 
     steps:
       - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+        with:
+          persist-credentials: false
 
       - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
         with:
diff --git a/.github/workflows/package-manager-builds.yaml b/.github/workflows/package-manager-builds.yaml
index 8754a7c1..1c5bb2cc 100644
--- a/.github/workflows/package-manager-builds.yaml
+++ b/.github/workflows/package-manager-builds.yaml
@@ -17,6 +17,8 @@ jobs:
 
     steps:
     - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+      with:
+        persist-credentials: false
 
     - name: Install conan
       run: python -m pip install --requirement requirements-conan.txt
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
new file mode 100644
index 00000000..74f63d1c
--- /dev/null
+++ b/.github/workflows/scorecard.yml
@@ -0,0 +1,52 @@
+# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
+
+name: Scorecard
+
+# OpenSSF Scorecard grades how the repository itself is kept: branch
+# protection, pinned dependencies, token permissions, and more. It reads the
+# default branch only. Its findings are uploaded to code scanning.
+
+on:
+  branch_protection_rule:
+  push:
+    branches:
+      - devel
+  schedule:
+    - cron: '37 5 * * 2'
+
+permissions: {}
+
+jobs:
+  analysis:
+    name: Scorecard analysis
+    runs-on: ubuntu-latest
+    timeout-minutes: 15
+    permissions:
+      actions: read
+      contents: read
+      id-token: write
+      security-events: write
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+        with:
+          persist-credentials: false
+
+      - name: Run the analysis
+        uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
+        with:
+          results_file: results.sarif
+          results_format: sarif
+          publish_results: false
+
+      - name: Keep the results
+        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+        with:
+          name: scorecard-results
+          path: results.sarif
+          retention-days: 5
+
+      - name: Upload to code scanning
+        uses: github/codeql-action/upload-sarif@7999b86c43a865dc79d8923397f35af22de63401 # v4
+        with:
+          sarif_file: results.sarif
diff --git a/.github/workflows/validate-header-guards.yml b/.github/workflows/validate-header-guards.yml
index 9b85a912..930bbea6 100644
--- a/.github/workflows/validate-header-guards.yml
+++ b/.github/workflows/validate-header-guards.yml
@@ -13,6 +13,8 @@ jobs:
 
       - name: Checkout source code
         uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+        with:
+          persist-credentials: false
 
       - name: Setup Dependencies
         uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
diff --git a/.github/workflows/windows-simple-builds.yml b/.github/workflows/windows-simple-builds.yml
index 2f244b32..b6174220 100644
--- a/.github/workflows/windows-simple-builds.yml
+++ b/.github/workflows/windows-simple-builds.yml
@@ -22,6 +22,8 @@ jobs:
         std: [14, 17]
     steps:
       - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
+        with:
+          persist-credentials: false
 
       - name: Configure build
         run: |
@@ -30,9 +32,9 @@ jobs:
                 -DCMAKE_CXX_STANDARD=${{matrix.std}} `
 
       - name: Build tests
-        run: cmake --build build --config ${{matrix.build_type}} --parallel %NUMBER_OF_PROCESSORS%
-        shell: cmd
+        run: cmake --build build --config ${{matrix.build_type}} --parallel $env:NUMBER_OF_PROCESSORS
+        shell: pwsh
 
       - name: Run tests
-        run: ctest --test-dir build -C ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS%
-        shell: cmd
+        run: ctest --test-dir build -C ${{matrix.build_type}} -j $env:NUMBER_OF_PROCESSORS
+        shell: pwsh
diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml
new file mode 100644
index 00000000..373068ad
--- /dev/null
+++ b/.github/workflows/zizmor.yml
@@ -0,0 +1,38 @@
+# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
+
+name: Workflow Security
+
+# zizmor reads the workflows of this repository for what makes a workflow
+# unsafe: a token that is wider than its job needs, text from a pull request
+# that reaches a shell, an action that is not pinned. Its findings are
+# uploaded to code scanning.
+
+on:
+  pull_request:
+  push:
+    branches:
+      - devel
+
+permissions: {}
+
+concurrency:
+  group: zizmor-${{ github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  zizmor:
+    name: zizmor
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    permissions:
+      actions: read
+      contents: read
+      security-events: write
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+        with:
+          persist-credentials: false
+
+      - name: Audit the workflows
+        uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4