ci(github-actions): add zizmor gate to lint workflow - #875
Merged
Conversation
Mirrors the zizmor job homelab-ops-terraform already runs, so workflow-file changes here get the same static-analysis/security gate as the rest of the org instead of being lint-checked ad hoc.
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.
Summary
Adds a
zizmorjob to.github/workflows/lint.yaml, mirroring the jobhomelab-ops-terraformalready runs (the closest structural analogue tothis repo — both matrix Terraform directories under a
detect-changes+terraform-dirssetup). This gives workflow-file changes in this repo thesame static-analysis/security gate (permissions, template-injection,
credential-handling, pinning) the rest of the org already applies via
ppat/github-workflows's reusablelint-zizmor.yaml, instead of beinglint-checked ad hoc per repo.
The job is gated the same way as the other
lint.yamljobs: it only runson PRs that touch
.github/workflows/**(viadetect-changes'actions_any_changed), or unconditionally onworkflow_dispatch/schedule.Why no fixes/suppressions were needed
I reproduced the exact CI invocation locally
(
zizmor --format=plain --min-severity=medium --min-confidence=high --persona=regular .,via
uvx zizmor, both offline and with a liveGH_TOKEN) against thisrepo's actual workflow files (
lint.yaml,release.yaml,renovate.yaml,test.yaml). Result: zero findings at the gate's thresholds.Findings do exist below the gate's bar (
excessive-permissionsatMediumconfidence because several jobs rely on default permissions withno
permissions:block; severaltemplate-injectionhits atInfo/helpseverity from
${{ }}interpolated intorun:blocks inlint.yaml/release.yaml; a fewanonymous-definitioninfo notes) — butnone clear
--min-severity=medium --min-confidence=high, so the gate(matching
homelab-ops-terraform's exact invocation) passes clean with nozizmor.yamlsuppression file needed. Unlikehomelab-ops-terraform, thisrepo's
release.yaml/renovate.yamldon't callcreate-github-app-tokendirectly — they pass
app_id/app_private_keysecrets intoppat/github-workflowsreusable workflows, so thegithub-appfindingpattern (which lives inside those reusable workflows' own files, not this
repo's) doesn't appear here at all.
Also verified while scoping this change:
actions/checkoutis alreadypinned at
@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1at all 3call sites (
test.yaml,release.yaml,lint.yaml) — already current,untouched.
actions/cacheis not used anywhere in this repo — nothing toadd.
Findings table
excessive-permissions(nopermissions:block) —release.yaml,renovate.yaml(multiple jobs/workflow-level)template-injection—lint.yamlterraform-dirsstep (github.event_name,fromJSON(...)interpolations)template-injection—release.yaml(secrets.CODER_EMAIL/CODER_PASSWORDinrun:,github.repositoryinRELEASE_MSG)anonymous-definition(job withoutname:) —lint.yaml:terraform-dirs,release.yaml:publish-template,test.yaml:watchdogNo suppression file (
zizmor.yaml) was added, since nothing needed suppressing.Test plan
pre-commit run --files .github/workflows/lint.yaml— all hooks passactionlint .github/workflows/lint.yaml— only a pre-existing, unrelatedshellchecknote in the untouchedterraform-dirsjob (confirmed present onmainbefore this change too)uvx zizmor --format=plain --min-severity=medium --min-confidence=high --persona=regular .(offline and withGH_TOKEN) — 0 findingszizmorjob itself, plus existing lint jobs)