fix(security): scope CI secrets and pin third-party actions - #5171
Open
causten wants to merge 1 commit into
Open
fix(security): scope CI secrets and pin third-party actions#5171causten wants to merge 1 commit into
causten wants to merge 1 commit into
Conversation
Addresses ROCM-26618, ROCM-26607, ROCM-26609. Keeps existing self-hosted job behavior for tidy/cppcheck/sles (ROCM-26603 already handled elsewhere). Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions CI workflow by reducing the scope of sensitive credentials and improving supply-chain safety for third-party actions.
Changes:
- Scoped DockerHub credentials to only the image publish jobs and prevented those jobs from running on fork PRs.
- Replaced a hardcoded Codecov token with the
CODECOV_TOKENsecret. - Pinned
jlumbroso/free-disk-spaceto a specific commit SHA.
Suppressed comments (1)
.github/workflows/ci.yaml:110
- Same issue as
build_image: with this job skipped on fork PRs when the SLES image tag does not exist, downstream jobs that assume the image exists can still run (because they treatskippedas acceptable) and then fail when they try to use the missing image. Consider gating downstream SLES-image consumers onimageexists_sles == 'true'for fork PRs, or make this job fail fast (without touching secrets) when it cannot build/push.
if: >-
${{ needs.check_image.outputs.imageexists_sles != 'true'
&& (github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository) }}
env:
DOCKER_USER: ${{ secrets.DOCKERHUB_USERID }}
DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+3
to
+4
| permissions: | ||
| contents: read |
Comment on lines
+75
to
+81
| if: >- | ||
| ${{ needs.check_image.outputs.imageexists != 'true' | ||
| && (github.event_name != 'pull_request' | ||
| || github.event.pull_request.head.repo.full_name == github.repository) }} | ||
| env: | ||
| DOCKER_USER: ${{ secrets.DOCKERHUB_USERID }} | ||
| DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |
Comment on lines
504
to
+507
| - name: Upload code coverage | ||
| if: "matrix.configuration == 'codecov'" | ||
| env: | ||
| CODECOV_TOKEN: "f5d5a10b-3177-4c76-b25f-9b1c2f165e8b" | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
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
JIRA
Test plan
Made with Cursor