ci: adopt tctest's pinned tooling, workflow hardening, and release signing; go 1.26.6 - #116
Merged
Conversation
….26.6 - .tools/go.mod pins dev tools (golangci-lint w/ azproviderlint plugin, actionlint, gofumpt); makefile builds them into .tools/bin - add actionlint, shellcheck, and yamllint targets + workflows; azurerm-style workflow naming - pin all github actions by commit hash; restrict codeql token permissions - enable azproviderlint (AZG) and revive; fix resulting findings - add SECURITY.md; bump go to 1.26.6
- cosign keyless-signs checksums.txt into a v3 sigstore bundle (checksums.txt.sigstore.json) - github artifact attestations via actions/attest-build-provenance (subject-checksums) - SLSA build L3 provenance from the slsa-github-generator reusable workflow (tag-pinned; it verifies its own ref and rejects hash refs) - release.yaml also picks up hash-pinned actions and job-scoped contents: write
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.
Ports katbyte/tctest#123, katbyte/tctest#125, katbyte/tctest#128, katbyte/tctest#129, and katbyte/tctest#133 to terrafmt, plus a few repo-specific changes.
Dependencies (
deps: copy in diff from my forks)andreyvit-diffanddiffmatchpatchforks in-tree underlib/diff/, dropping the external fork modules from go.mod/vendorPinned dev tooling & linters (tctest#123)
.tools/go.modpins golangci-lint, actionlint, and gofumpt; make builds them into.tools/bin(single source of truth for make and CI, dependabot keeps them bumped — quarterly, since tools should move slowly)golangci-with-modules) compiles in the azproviderlint module plugin;AZGgeneral-Go rules enabledactionlint,yamllint,shellcheckmake targets + workflows (with actionlint problem matcher for inline annotations);check-allruns everythinglib/diff/diffmatchpatch/excluded from revive to stay diff-able against upstream go-diffpr-*prefixes, Title Case names); README badges/dev docs updatedWorkflow hardening (tctest#125)
contents: read; releasecontents: writescoped to the goreleaser job onlypr-depscheckalso triggers on.tools/**and verifies.toolstidy + the golangci version match with.custom-gcl.ymlSECURITY.md (tctest#128)
Signed releases & provenance (tctest#129 + #133)
checksums.txtinto a v3 sigstore bundle (checksums.txt.sigstore.json) — lands with the cosign v3--bundleformat directly, skipping the broken.sig/.pemintermediate that bit tctest v1.3.2actions/attest-build-provenance(subject-checksums); verify withgh attestation verify <file> -R katbyte/terrafmtslsa-github-generatorreusable workflow (it verifies its own ref and rejects hash pins)go 1.26.6
.go-version/ go directives bumped to match tctest; unlocks AZG002's defaultnew(expr)suggestion and the go 1.26errors.AsTypemodernize rewrite incli/flags.goVerification
make check-allgreen: build, tests (-race), lint (0 issues), actionlint, yamllint, shellcheck, depscheckcosign verify-blob --bundlepasses; SLSA generator and attest action inputs verified against the pinned refschecksums.txt.sigstore.json+multiple.intoto.jsonlon the release)Notes:
//nolint:azproviderlintinblockreader.go: AZG006's inline suggestion would moveastutil.Applypast theLineCountread that observes its side effects (its autofix brokeTestCmdFmtStdinVerbose; worth a look in azproviderlint itself)