feat: run the canonical gate and practice the security it teaches - #40
Merged
Conversation
The course teaches pip-audit, gitleaks and Trivy in chapter 4.4 and practiced only gitleaks. It now runs all three, plus the workflow linting nothing covered. - add the `all` task (format, check, build) and run it as the single CI step, with a clean-porcelain assertion. No `test` task: this repository is prose and `mkdocs build --strict` is its only executable assertion - add check:actions (actionlint + zizmor), check:vuln (pip-audit), and check:scan (trivy) with a committed trivy.yaml; extend check:format with validate-pyproject and `uv lock --check` - add a weekly full-history security workflow and a grouped dependabot config - pin python 3.14 in [tools] and commit mise.lock, so CI provisions the exact interpreter the course tells readers to pin - pages.yml: a job-level permissions block replaces the workflow-level one, so the deploy job was running with contents: none. Spell all three out - assign.yml: bump pozil/auto-assign-issue v2 -> v4 and scope it to issues. On a fork pull request the token is read-only regardless of the permissions block, so this workflow was guaranteed to fail on exactly the external contributions the README invites - lefthook priorities 10/20/30, with the hook name mirroring a real format:dprint task - pyproject: PEP 639 license form; drop the .mypy_cache ignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Brings the course repository's own tooling up to the stack it teaches, ahead of the chapter rewrites.
Why
pip-audit,gitleaksand Trivy. The repository ran onlygitleaks.pages.ymldeclaredcontents: readat workflow level and onlypages/id-tokenat job level. A job-levelpermissions:block replaces the workflow-level one, so the deploy job was running withcontents: none.assign.ymlwas two majors behind, and itspull_request: [opened]trigger gets a read-only token on fork PRs regardless of thepermissions:block — so it was guaranteed to put a red X on exactly the external contributions the README invites.How
alltask (format → check → build), run as the single CI step withtest -z "$(git status --porcelain)". Notesttask was invented: this repository is prose, andmkdocs build --strictis its only executable assertion —check:buildalready runs it.check:actions(actionlint + zizmor),check:vuln(pip-audit),check:scan(trivy, with a committedtrivy.yaml);check:formatextended withvalidate-pyprojectanduv lock --check.security.yml; grouped Dependabot with thechore(deps)prefix.python = "3.14"pinned in[tools]andmise.lockcommitted, so CI provisions the interpreter the course tells readers to pin.pages.ymlspells out all three permission scopes;assign.ymlbumped to v4 and scoped to issues (rather than hiding a certain failure behindcontinue-on-error).format:dprinttask..mypy_cacheignore dropped from a repository with no Python sources.Test plan
mise run all— exit 0;mkdocs build --strictgreen (and green before the change, so no pre-existing docs breakage was masked).zizmor --offline .github/workflows/— "No findings to report" across all four workflows.trivy --config trivy.yaml fs .— 0 findings across all four scanners.lefthook validate— "All good"; gate run twice with identical exit code and porcelain output.pozil/auto-assign-issuev3 (CommonJS→ESM) and v4 (Node 24) renamed no inputs before bumping.Not in this PR
Chapter content.
docs/**is untouched here so the prose rewrite lands as its own reviewable change.