Skip to content

Update copier exclusions - #5

Merged
ahcodedev merged 2 commits into
mainfrom
update-copier-exclusions
Nov 7, 2026
Merged

ahcodedev merged 2 commits into
mainfrom
update-copier-exclusions

Conversation

@ahcodedev

Copy link
Copy Markdown
Owner

Summary

Adds security, quality and dependency tooling to this repo and to the Copier template, so that every generated project starts with the same checks locally, in Git hooks and in CI.

GitHub Actions security

  • zizmor and actionlint run in just lint in both repos. actionlint comes from Homebrew locally and is installed with uv (actionlint-py) in CI and the dev container.
  • All actions are pinned to commit hashes with a version comment, and actions/checkout sets persist-credentials: false.
  • gitleaks runs as a pre-commit hook on staged changes, as just gitleaks for a full history scan, and as a CI job using gitleaks/gitleaks-action v3. The job has pull-requests: read so PR scans work in private repos.

Git hooks

  • prek (prek.toml) runs just lint and gitleaks before each commit. just setup in the template installs the hooks, and so does the dev container when the workspace is a Git repo.

Rust tooling (template)

  • cargo-deny (deny.toml, just deny): security advisories, an allowlist of permissive licenses, banned crates and crates.io-only sources. It runs as a separate CI step.
  • MSRV check (just msrv, a new CI job): builds with the rust-version from Cargo.toml, which is raised to 1.99.
  • cargo-nextest: just test runs nextest, then cargo test --doc.
  • Coverage (just coverage, a CI step): cargo-llvm-cov fails below coverage_threshold (98% by default, set at the top of the justfile). src/main.rs is excluded. Adds the llvm-tools-preview toolchain component.
  • Rustdoc runs with -D warnings in just lint to catch broken doc links.
  • cargo-shear in just lint catches unused dependencies.
  • [lints] table: unsafe_code = "forbid", missing_docs = "warn" and clippy pedantic. The starter code is updated to pass.
  • bacon.toml (optional): makes nextest the default bacon job.

Formatting and spelling (both repos)

  • typos in just lint.
  • tombi checks TOML formatting in just lint, and just fmt fixes it. deny.toml, rust-toolchain.toml and the Cargo.toml lint tables are reformatted to match.

Tool installation

  • cargo-deny, cargo-nextest, cargo-shear, cargo-llvm-cov and typos are pinned in cargo_tools in each justfile. just install-tools installs them with cargo-binstall, installing cargo-binstall itself with cargo install if needed.
  • just update bumps the pinned versions to the latest releases and reinstalls them.
  • Everything else comes from Homebrew. Recipes add ~/.cargo/bin and Homebrew's rustup to the PATH.
  • CI installs tools with taiki-e/install-action. The dev container uses cargo install for zizmor, prek and uv, just install-tools for the pinned tools, and a checksum-verified gitleaks release.

Dependabot

  • .github/dependabot.yml in both repos sets up weekly grouped updates with a 7-day cooldown: GitHub Actions in this repo (including template/), and Cargo plus GitHub Actions in the template.
  • dependabot-auto-merge.yml squash-merges patch and minor updates once CI passes. Major updates wait for review.

Template behaviour

  • copier update no longer touches src/lib.rs, src/main.rs or tests/greeting.rs, so projects can change, move or delete the starter code. _min_copier_version is raised to 9.6.0.
  • Adds PR templates to both repos.
  • just test-template now also runs just coverage and just deny on the generated project.

Docs

  • Both READMEs and template/CLAUDE.md describe the new commands, checks, setup and Dependabot behaviour.

Setup needed after merging

  • Auto-merge: turn on "Allow auto-merge" and add a branch protection rule or ruleset on main that requires the CI checks. Private repos need a paid GitHub plan for this.
  • Organization-owned repos: add a GITLEAKS_LICENSE secret, both as an Actions secret and as a Dependabot secret.

Not yet tested

  • the workflows running on GitHub
  • a dev container build
  • a copier update on a project that has moved or deleted the starter files

Checklist

  • just lint passes
  • just test-template passes
  • Docs updated if needed (README.md, template/README.md.jinja, template/CLAUDE.md)

@ahcodedev
ahcodedev merged commit 3104243 into main Nov 7, 2026
3 checks passed
@ahcodedev
ahcodedev deleted the update-copier-exclusions branch November 7, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant