Harden S3 publish workflows against zizmor findings - #6543
Conversation
Address GitHub Actions static-analysis (zizmor/CodeQL) findings in the
S3 publishing workflows:
- publish-release.yml: hoist every inputs/secrets/vars value used inside
run blocks into job-level env vars and reference plain shell variables
($USE_TAG, $FILE_NAME, $TARGET_DIR, $S3_BUCKET, $TARGET_PATH, $DRY_RUN),
eliminating 41 template-injection findings. Add persist-credentials:
false to the checkout (artipacked).
- publish-branch.yml: add persist-credentials: false to the checkout
(artipacked); its S3 sync already used env vars.
No behavioral change: the same values are used, only via the shell
environment instead of direct ${{ }} expansion into the script body.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deconfliction with #6542 (hdf5.tag)This PR and #6542 both modify the
The clean merged result keeps this PR's job-level - name: Process documentation
run: |
set -euo pipefail
DOC_FILE="HDF5/${FILE_NAME}.doxygen.zip"
if [ -f "$DOC_FILE" ]; then
echo "📚 Processing documentation..."
unzip -q "$DOC_FILE"
if [ -d "${FILE_NAME}.doxygen" ]; then
echo "✅ Documentation extracted successfully"
else
echo "❌ Documentation extraction failed"
exit 1
fi
+ # The doxygen tag file is published alongside the HTML docs
+ if [ -f "${FILE_NAME}.doxygen/hdf5.tag" ]; then
+ echo "✅ Found: hdf5.tag"
+ else
+ echo "❌ hdf5.tag not found in documentation"
+ exit 1
+ fi
else
echo "⚠️ Documentation file not found, skipping..."
fiNote: the added check references |
There was a problem hiding this comment.
Pull request overview
This PR hardens the two S3 publishing GitHub Actions workflows against zizmor/CodeQL findings by removing ${{ ... }} expression interpolation from shell run: blocks (mitigating template-injection risks) and by disabling persisted checkout credentials where they are not needed.
Changes:
- Hoists
inputs.*,secrets.*, andvars.*used by shell scripts inpublish-release.ymlinto job-levelenv:variables and references them via shell variables insiderun:blocks. - Adds
persist-credentials: falsetoactions/checkoutin both publishing workflows to address theartipackedfinding.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/publish-release.yml |
Moves templated values out of run: blocks into job env: and disables persisted checkout credentials to mitigate template-injection and credential persistence findings. |
.github/workflows/publish-branch.yml |
Disables persisted checkout credentials to reduce unnecessary credential exposure during S3 publishing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review ChecklistThis PR touches the following areas. Each needs a sign-off
|
Summary
Addresses GitHub Actions static-analysis (zizmor / CodeQL "GitHub Advanced Security") findings in the S3 publishing workflows. These are the two workflows that publish release artifacts and documentation to S3, and they carried the bulk of the
template-injectionfindings.Changes
.github/workflows/publish-release.yml(41template-injection+ 1artipacked)inputs.*/secrets.*/vars.*value used insiderun:blocks into job-levelenv:variables (USE_TAG,FILE_NAME,TARGET_DIR,DRY_RUN,S3_BUCKET,TARGET_PATH) and reference plain shell variables ($USE_TAG, …) instead of interpolating${{ ... }}directly into the script body. This removes the code-injection vector where a value is expanded into the script before the shell runs.persist-credentials: falseto theactions/checkoutstep (artipacked). This workflow does not push to git; it only reads sources/scripts and uses separate AWS credentials..github/workflows/publish-branch.yml(1artipacked)persist-credentials: falseto theactions/checkoutstep. Its S3 sync step already usedenv:variables.No behavioral change
The same values are used — only sourced from the shell environment instead of direct
${{ }}expansion.if:conditions and actionwith:inputs are left as-is (those are not shell-injection contexts).Verification
zizmor(v1.25.2, the pinned version fromzizmor.yml) reports no findings on either file after the change.Scope note
The remaining zizmor findings across other workflows (
maven-*,java-*, additionalartipacked, andexcessive-permissions) are intentionally not included here. Those require per-workflow analysis — e.g.persist-credentials: falsewould break checkouts used forgit push/ gh-pages deploys, and minimalpermissions:blocks need to be verified against each job's needs — and are better handled as separate, focused follow-ups.🤖 Generated with Claude Code