-
-
Notifications
You must be signed in to change notification settings - Fork 927
Replace GitHub Actions version tags with SHA for deterministic builds… #1159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Replace GitHub Actions version tags with SHA for deterministic builds… #1159
Conversation
Summary by CodeRabbit
WalkthroughAll modifications are in the CI/CD workflow: action usages across the workflow were changed from broad/major-version references to explicit, pinned versions or SHAs (checkout, setup-python, CodeQL, pre-commit, artifact and Docker actions). No job additions, removals, or control-flow restructuring were introduced. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci_cd.yml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/ci_cd.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
🔇 Additional comments (12)
.github/workflows/ci_cd.yml (12)
328-328: Verify pypa/gh-action-pypi-publish SHA matches intended release.As noted in the PR description, this action SHA requires explicit review to confirm it references the intended release version. This action publishes packages to PyPI and TestPyPI registries, making it a critical security checkpoint.
Please confirm:
- That SHA
ed0c53931b1dc9bd32cbe73a98c7f6766f8a527ecorresponds to an official, stable release of pypa/gh-action-pypi-publish- The release date and changelog for this version
- Any security advisories or breaking changes in this version
You can verify this by checking the GitHub repository: https://github.com/pypa/gh-action-pypi-publish/releases and matching the commit SHA.
Also applies to: 354-354
3-17: Approve workflow metadata and trigger configuration updates.The workflow triggers (merge_group, pull_request, push, workflow_dispatch) and concurrency configuration are well-structured. The concurrency group prevents duplicate runs and improves resource efficiency.
21-33: Approve pre-commit job configuration with pinned SHAs.The pre-commit job properly uses SHAs for deterministic builds and follows best practices for GitHub Actions security.
35-60: Approve CodeQL job configuration with pinned SHAs.The CodeQL security scanning job is properly configured with consistent SHAs across both init and analyze steps. The matrix strategy for multiple languages is appropriate.
63-84: Approve test job configuration with pinned SHAs.The run-tests job correctly depends on pre-commit completion and uses pinned SHAs. Poetry-based dependency and test execution is properly configured.
86-113: Approve build and artifact upload with pinned SHAs.The build-package job properly downloads, builds, and uploads artifacts using consistent pinned SHAs across all steps.
115-147: Approve cross-platform testing with pinned SHAs.The test-build-package job correctly tests both macOS and Ubuntu platforms using both wheel and source distributions. Artifact handling uses consistent pinned SHAs.
150-200: Approve Docker image testing with pinned SHAs.The test-docker-image job comprehensively tests Docker image functionality including localization (Persian), modules, profiles, and command execution. Uses pinned SHAs correctly.
202-240: Approve Docker version matrix testing with pinned SHAs.The test-docker-image-build job tests multiple Docker versions (27.5.0, 26.1.4, 26.0.0) following official Docker documentation, using pinned SHAs.
242-305: Approve Docker registry publishing jobs with pinned SHAs.Both dev and release Docker publishing jobs are properly gated with repository and ref checks, use consistent pinned SHAs across all setup steps, and follow Docker best practices.
307-354: Approve PyPI publishing jobs structure with pinned SHAs (pending SHA verification).Both Test PyPI and PyPI publishing jobs are properly configured with correct environment gating, OIDC permissions, and artifact handling. SHAs are consistent across both jobs. Subject to verification of the pypa/gh-action-pypi-publish SHA noted above.
1-18: All action SHAs verified as legitimate and current.All 11 action SHAs in the workflow have been validated against their official GitHub repositories and confirmed as valid commits. The pypa/gh-action-pypi-publish SHA corresponds to the latest stable release v1.13.0 (released 2025-09-04). The security practice of pinning to commit SHAs is properly implemented throughout the workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@sukhmancode thank you for your contribution. Please make sure to run pre-commit checks locally next time.
Thanks 👍
// @securestep9 this awaits your approval to merge
(Issue #1158)
Proposed change
This PR replaces all version tags (
@v1,@v2,@v5) in GitHub Actions workflows with the exact commit SHAs. This ensures deterministic builds and improves security by locking the workflow actions to specific versions.Note: The
pypa/gh-action-pypi-publishaction was originally usingrelease/@v1; I replaced it with the latest SHA. Please review this SHA to ensure it aligns with the intended release.All other actions remain functionally identical.
Type of change
Checklist
make pre-commit, it didn't generate any changesmake test, all tests passed locally