Repository navigation
Conversation
- set least-privilege permissions on every workflow and job - stop persisting checkout credentials, except for the gh-pages deploy - pin actions/setup-go and the Lightning-AI/utilities composite actions to commits - replace the archived gh-actions-cache extension with gh cache delete - fix the checkout version comment in docs-build - add a 7-day Dependabot cooldown
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #956 +/- ##
=====================================
Coverage 82% 82%
=====================================
Files 72 72
Lines 16445 16445
=====================================
Hits 13505 13505
Misses 2940 2940 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the workflow security-hardening changes.
No open issues 🎉
What changed in this PR
Hardens litData’s GitHub Actions workflows against zizmor findings by restricting token permissions, reducing persisted credentials, and pinning executable dependencies.
Changes:
- Sets explicit token permissions and disables checkout credential persistence except for documentation deployment.
- Pins Go setup and shared-action references; replaces the cache-cleanup extension with the built-in GitHub CLI command and skips fork PRs.
- Adds seven-day Dependabot cooldowns and corrects the documentation checkout’s version comment.
| File | Description |
|---|---|
.github/workflows/torch-policy.yml |
Disables checkout credential persistence. |
.github/workflows/release-pypi.yml |
Scopes build and release permissions; disables persisted checkout credentials. |
.github/workflows/greetings.yml |
Limits the greeting job to issue-write access. |
.github/workflows/docs-build.yml |
Scopes deployment write access, explicitly retains credentials, and corrects a version comment. |
.github/workflows/cleanup-caches.yml |
Uses built-in cache deletion with scoped permissions and skips fork PRs. |
.github/workflows/ci-testing.yml |
Sets read-only permissions and disables persisted checkout credentials. |
.github/workflows/ci-litsim.yml |
Pins Go setup and restricts permissions and credential persistence. |
.github/workflows/ci-checks.yml |
Sets read-only permissions and pins shared-action references. |
.github/dependabot.yml |
Adds seven-day cooldowns for dependency and action updates. |
Review effort: Balanced
|
nice work. Do you think we should consider adding a minimal CI or pre-commit or something that looks for security issues in CI workflow files? |
Thanks! yeah, maybe we could add it in the pre-commit file, but I wouldn't recommend adding it as a CI action. |
What does this PR do?
Hardens the GitHub Actions workflows based on a zizmor scan (1 high, 21 medium, 7 low findings → none).
permissions:on every workflow; write access only where a job needs it (docs-deploy,upload-release-assets,greetings,cleanup-caches).persist-credentials: falseon every checkout exceptdocs-deploy, which pushes to gh-pages.actions/setup-goto a commit, and passes theLightning-AI/utilitiescommit asactions-refinstead ofmain.cleanup-cachesuses the built-ingh cache deleteinstead of installing the archivedgh-actions-cacheextension.# v6.0.2comment on the checkout pin indocs-build.Details
actions-ref: main:check-typingandcheck-packagecheck outLightning-AI/utilitiesat this ref and run its composite actions, so the workflow's commit pin didn't cover that code. The other shared workflows leaveactions-refempty and don't fetch it.ci-checks/docs-builduse no token beyond reading the repo, socontents: readat the caller is enough.cleanup-cachesnow skips fork PRs: their token is read-only, so the old script's deletes already failed silently there (set +e).git merge-tree.pypienvironment with required reviewers topublish-pypi. It needs admin setup in repo settings and on PyPI's trusted publisher, so it's left as a follow-up.${{ needs.pytester.result }}echo) are left as is.