From 3c1a2f4fb34ea0202c49217bbdb8e9b655d80a0e Mon Sep 17 00:00:00 2001 From: Aaron <7063649+ahcodedev@users.noreply.github.com> Date: Wed, 11 Nov 2026 15:06:25 -0800 Subject: [PATCH 1/2] Update badges and docs --- README.md | 6 +++++- justfile | 1 - template/README.md.jinja | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7955cd..d1a5483 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,16 @@ [![Template](https://github.com/ahcodedev/rust-template/actions/workflows/template.yml/badge.svg?branch=main)](https://github.com/ahcodedev/rust-template/actions/workflows/template.yml) [![gitleaks](https://img.shields.io/badge/protected%20by-gitleaks-blue)](https://github.com/gitleaks/gitleaks) +[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier) +[![just](https://img.shields.io/badge/built%20with-just-blue)](https://github.com/casey/just) +[![prek](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json)](https://github.com/j178/prek) +[![Dependabot](https://img.shields.io/badge/Dependabot-enabled-blue?logo=dependabot)](https://docs.github.com/code-security/dependabot) Rust project template for [Copier](https://copier.readthedocs.io/). ## Usage -- Create a new project - `copier copy gh:/rust-template path/to/new-project` +- Create a new project - `copier copy gh:ahcodedev/rust-template path/to/new-project` - Pull in template updates from inside a generated project - `just update-template` (runs `copier update`) ## Development diff --git a/justfile b/justfile index b104877..da06669 100644 --- a/justfile +++ b/justfile @@ -67,7 +67,6 @@ test-template: # -r HEAD renders the current checkout, including uncommitted changes copier copy --defaults -r HEAD \ -d project_name=test-project \ - -d author_name=Test \ -d copyright_year={{ datetime("%Y") }} \ "{{ justfile_directory() }}" "$tmp/test-project" cd "$tmp/test-project" diff --git a/template/README.md.jinja b/template/README.md.jinja index b34209a..c33dfa4 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -2,6 +2,10 @@ [![Rust](https://github.com/{{ github_owner }}/{{ github_repo }}/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/{{ github_owner }}/{{ github_repo }}/actions/workflows/rust.yml) [![gitleaks](https://img.shields.io/badge/protected%20by-gitleaks-blue)](https://github.com/gitleaks/gitleaks) +[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier) +[![just](https://img.shields.io/badge/built%20with-just-blue)](https://github.com/casey/just) +[![prek](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json)](https://github.com/j178/prek) +[![Dependabot](https://img.shields.io/badge/Dependabot-enabled-blue?logo=dependabot)](https://docs.github.com/code-security/dependabot) {{ description }} From 721ffeffd968cf2ba1fd0d3175b9772df0586088 Mon Sep 17 00:00:00 2001 From: Aaron <7063649+ahcodedev@users.noreply.github.com> Date: Wed, 11 Nov 2026 15:11:09 -0800 Subject: [PATCH 2/2] Add zizmor badge and CI job --- .github/workflows/template.yml | 18 ++++++++++++++++++ README.md | 6 +++++- template/.github/workflows/rust.yml | 18 ++++++++++++++++++ template/CLAUDE.md | 2 +- template/README.md.jinja | 5 ++++- 5 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/template.yml b/.github/workflows/template.yml index c1fa1ac..028d949 100644 --- a/.github/workflows/template.yml +++ b/.github/workflows/template.yml @@ -52,6 +52,24 @@ jobs: - name: Generate and test project run: just test-template + zizmor: + runs-on: ubuntu-latest + # Uploads findings to the repository's code scanning alerts instead of failing the job. + # contents and actions: read are only needed for private repos. + permissions: + contents: read + actions: read + security-events: write + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + # Also runs zizmor's online audits (e.g. known-vulnerable actions), which `just lint` skips + - name: Audit workflows + uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1 + gitleaks: runs-on: ubuntu-latest # Job-level permissions replace the workflow-level ones, so contents: read is repeated here. diff --git a/README.md b/README.md index d1a5483..dd2f3bc 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![just](https://img.shields.io/badge/built%20with-just-blue)](https://github.com/casey/just) [![prek](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json)](https://github.com/j178/prek) [![Dependabot](https://img.shields.io/badge/Dependabot-enabled-blue?logo=dependabot)](https://docs.github.com/code-security/dependabot) +[![zizmor](https://img.shields.io/badge/%F0%9F%8C%88-zizmor-white?labelColor=white)](https://zizmor.sh/) Rust project template for [Copier](https://copier.readthedocs.io/). @@ -31,7 +32,10 @@ Commands are defined in the `justfile` and run with [just](https://github.com/ca - Render the template into a temp directory, then lint, test, check coverage and check dependencies of the generated project - `just test-template` - Scan the Git history for committed secrets - `just gitleaks` -CI runs `just lint` and `just test-template`, and scans the Git history for secrets with gitleaks. +CI runs `just lint` and `just test-template`, scans the Git history for secrets with gitleaks, and audits the workflows with [zizmor-action](https://github.com/zizmorcore/zizmor-action). + +- zizmor-action reports findings as code scanning alerts in the repository's Security tab rather than failing CI + - Code scanning needs a public repo, or GitHub Advanced Security on a private one ## Dependency Updates diff --git a/template/.github/workflows/rust.yml b/template/.github/workflows/rust.yml index 0bceba6..c2f0446 100644 --- a/template/.github/workflows/rust.yml +++ b/template/.github/workflows/rust.yml @@ -75,6 +75,24 @@ jobs: - name: Check minimum supported Rust version run: just msrv + zizmor: + runs-on: ubuntu-latest + # Uploads findings to the repository's code scanning alerts instead of failing the job. + # contents and actions: read are only needed for private repos. + permissions: + contents: read + actions: read + security-events: write + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + # Also runs zizmor's online audits (e.g. known-vulnerable actions), which `just lint` skips + - name: Audit workflows + uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1 + gitleaks: runs-on: ubuntu-latest # Job-level permissions replace the workflow-level ones, so contents: read is repeated here. diff --git a/template/CLAUDE.md b/template/CLAUDE.md index 39273b7..dc7798c 100644 --- a/template/CLAUDE.md +++ b/template/CLAUDE.md @@ -18,7 +18,7 @@ Run project tasks through `just` (see `justfile`) rather than calling `cargo` di - `just deny` - check dependencies for security advisories, licenses, banned crates and sources (`deny.toml`) - `just gitleaks` - scan the Git history for committed secrets -Run `just fmt` and `just lint` after making changes; CI runs `just lint`, `just test`, `just coverage`, `just deny` and `just msrv` and fails on any warning, and scans the Git history for secrets with gitleaks. +Run `just fmt` and `just lint` after making changes; CI runs `just lint`, `just test`, `just coverage`, `just deny` and `just msrv` and fails on any warning, scans the Git history for secrets with gitleaks, and audits the workflows with zizmor-action, which reports findings as code scanning alerts. ## Git hooks diff --git a/template/README.md.jinja b/template/README.md.jinja index c33dfa4..9624462 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -6,6 +6,7 @@ [![just](https://img.shields.io/badge/built%20with-just-blue)](https://github.com/casey/just) [![prek](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json)](https://github.com/j178/prek) [![Dependabot](https://img.shields.io/badge/Dependabot-enabled-blue?logo=dependabot)](https://docs.github.com/code-security/dependabot) +[![zizmor](https://img.shields.io/badge/%F0%9F%8C%88-zizmor-white?labelColor=white)](https://zizmor.sh/) {{ description }} @@ -67,7 +68,9 @@ Optional: re-run the tests each time you save with [bacon](https://dystroy.org/b - `just lint` - [gitleaks](https://github.com/gitleaks/gitleaks) on the staged changes - Install them manually with `prek install` -- CI runs `just lint`, `just test`, `just coverage`, `just deny` and `just msrv`, and scans the Git history for secrets with gitleaks +- CI runs `just lint`, `just test`, `just coverage`, `just deny` and `just msrv`, scans the Git history for secrets with gitleaks, and audits the workflows with [zizmor-action](https://github.com/zizmorcore/zizmor-action) + - zizmor-action reports findings as code scanning alerts in the repository's Security tab rather than failing CI + - Code scanning needs a public repo, or GitHub Advanced Security on a private one; otherwise the zizmor job fails, so set `advanced-security: false` on the action to report findings as job failures instead - Repos owned by a GitHub organization need a `GITLEAKS_LICENSE` secret for the gitleaks job; personal repos don't - Dependabot PRs only get Dependabot secrets, so organization repos also need `GITLEAKS_LICENSE` added as a Dependabot secret