ci: harden workflows with pinned SHAs and explicit permissions#69
Conversation
Pin all third-party GitHub Actions in build.yaml and test.yml to full-length commit SHAs with version comments so the exact action code running in CI cannot change silently if a tag is force-moved. Dependabot is already configured and will keep these in sync. Add a top-level `permissions: contents: read` default to both workflows. The build job in build.yaml retains `contents: write` explicitly so it can still publish releases; this replaces the previous workflow-wide grant. Also quote shell variable expansions in build.yaml's release-version and tarball-packaging steps to silence SC2086 warnings reported by actionlint/shellcheck. Verified with actionlint v1.7.12 — no warnings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughGitHub Actions workflows are updated to pin action versions to specific commit SHAs instead of moving tags, add explicit top-level permissions declarations, and quote shell variables and file paths for security hardening across build and test pipelines. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
build.yamlandtest.ymlto full-length commit SHAs with version comments, so the exact action code running in CI cannot change silently if a tag is force-moved. Dependabot is already configured and will keep these in sync.permissions: contents: readdefault to both workflows. The build job inbuild.yamlretainscontents: writeexplicitly (job-level) so it can still publish releases; this replaces the previous workflow-wide grant.build.yaml's release-version and tarball-packaging steps to silenceSC2086warnings reported by actionlint/shellcheck.Verified with
actionlint v1.7.12— no warnings.Summary by CodeRabbit