Repository navigation
ci: harden Package workflow against supply-chain and injection risks - #2596
Merged
Merged
Conversation
Per GitHub Actions best practices, move context expressions (github.ref_name, steps.tag.outputs.name, etc.) into intermediate env: variables instead of interpolating them directly into shell scripts in the publish job.
zivy
approved these changes
May 14, 2026
zivy
left a comment
Member
There was a problem hiding this comment.
Possibly add a comment next to each commit sha indicating what version it corresponds to and saying that the immutable commit sha is used to ensure security and that the version tag which is modifiable originally pointed to that commit?
Member
Author
I just checked the docs: https://github.com/marketplace/actions/dependabot-sha-comment-action?version=v0.0.4 The version comment has to be on the same line for dependapot to do its things. |
blowekamp
force-pushed
the
harden-package-workflow
branch
from
May 14, 2026 20:49
2fd5a6b to
fc84a9e
Compare
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.
Addresses three security issues identified in the Package workflow and associated composite actions.
Changes
Prevent shell injection via context expressions (
publishjob)Context values (
github.ref_name,steps.tag.outputs.name, etc.) were interpolated directly into bash scripts. They are now passed through intermediateenv:variables, following GitHub's recommended practice.Pin third-party actions to full commit SHAs
All
actions/checkout,actions/setup-python,actions/upload-artifact,actions/download-artifact, andactions/cachereferences now use immutable commit SHAs instead of mutable version tags. CoversPackage.ymland the three composite actions.Fix
VCVAR_OPTIONSinterpolation incmdshell (package_csharp,package_java,package_python)${{ inputs.VCVAR_OPTIONS }}was written directly intocmdshell scripts. It is now passed viaenv:and referenced as%VCVAR_OPTIONS%.