updatted github action by change version tag to sha hashes #15315
+10
−13
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.
Which issue does this PR close?
Rationale for this change
This update strengthens the security of GitHub workflows by substituting version tags with precise SHA hashes for actions. This modification reduces the risks tied to supply chain attacks by guaranteeing that only validated action versions are utilized in the workflows. This method adheres to industry best practices for safeguarding CI/CD pipelines.
What changes are included in this PR?
Replaced version tags with specific SHA hashes for actions in the GitHub workflows.
Original:
dev.yml -> - uses: korandoru/hawkeye@v6
rust.yml -> - uses: korandoru/hawkeye@v6
setup-macos-aarch64-builder/action.yaml -> uses: Swatinem/rust-cache@v2
setup-rust-runtime/action.yaml -> uses: mozilla-actions/[email protected]
Update:
dev.yml -> -
uses: korandoru/hawkeye@dd74178a96f27b1121447c6b4a4ccfce180d5bf7
rust.yml -> -
uses: korandoru/hawkeye@dd74178a96f27b1121447c6b4a4ccfce180d5bf7
setup-macos-aarch64-builder/action.yaml ->
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
setup-rust-runtime/action.yaml ->
uses: mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd
Are these changes tested?
Yes, the changes are tested to ensure that the GitHub workflows function correctly with the specified SHA hashes.
Where I got this Hash:
korandoru/hawkeye@dd74178a96f27b1121447c6b4a4ccfce180d5bf7
:This is implemented in v6 of the original GitHub Action, but it redirects to v6.0.1. Consequently, I’ve bound the hash to v6.0.1 here for consistency and security.
korandoru/hawkeye@dd74178

Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
:This is implemented in v2 of the original GitHub Action, but it redirects to v2.7.8. Consequently, I’ve bound the hash to v2.7.8 here for consistency and security.
Swatinem/rust-cache@9d47c6a

mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd
:Mozilla-Actions/sccache-action@2e7f9ec
This is implemented in v0.0.4 of the original GitHub Action, so that I just bound the hash to v0.0.4 here for consistency and security.
Are there any user-facing changes?
No, all of that is under github action