Pin the cache action to a specific commit #49
Merged
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.
What does this PR do?
The "test-visibility-github-action" action uses the actions/cache action and pins it to the "v4" tag.
test-visibility-github-action/action.yml
Lines 86 to 87 in 4d09028
My PR updates this to pin "actions/cache" to a specific commit hash instead.
Motivation
Pinning an action to a tag instead of a commit is a bit more convenient because the tag can be moved by the action owner to the latest release. But for the same reason it's a bit less secure because the tag can also be moved to a compromised version by a malicious actor. Pinning to a specific commit ensures the chosen version can't be altered.
Furthermore, GitHub organizations have the option to enforce this as a mandatory policy. Since our org has that policy enabled, your action is blocked and we aren't able to use it.
Additional Notes
The "actions/cache" commit selected in this PR is the one currently tagged as "v4" and "v4.3.0".
For more background info: