Skip to content

Harden checkout credentials and env expansion in CI workflows - #41683

Merged
derrickaw merged 1 commit into
masterfrom
codescan/gha-workflow-note-hardening
Nov 25, 2026
Merged

derrickaw merged 1 commit into
masterfrom
codescan/gha-workflow-note-hardening

Conversation

@derrickaw

@derrickaw derrickaw commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:

  • The PR remediates confirmed, live Code Scanning finding(s) (CodeQL / zizmor) on master without altering intended public API or workflow semantics
  • The fix is minimal, idiomatic, and avoids masking underlying defects (false positives and noisy rules are dismissed or scoped via config rather than code churn)
  • Relevant unit tests, linters, Gemini review feedback, and live workflow_dispatch runs (for workflow/action changes) have been verified

Initiative Progress (as of 2026-11-25 20:43 UTC): 18 PRs merged so far, with ~16 more PRs needed to be merged to close out all actionable Code Scanning findings (with #41637 disabling Note-level zizmor/self-repository warnings).

Code Scanning Remediation Context (End Goal, Scope & Impact)

If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)

Summary

Resolves all 12 Note-level GitHub Code Scanning alerts (zizmor/artipacked and zizmor/template-injection) across .github/workflows/beam_PreCommit_Java_Kafka_Streams_Runner.yml, .github/workflows/codeql.yml, and .github/workflows/run_rc_validation_go_wordcount.yml:

  • .github/workflows/beam_PreCommit_Java_Kafka_Streams_Runner.yml (#3408): Sets persist-credentials: false on actions/checkout@v7.
  • .github/workflows/codeql.yml (#1908, #1875–#1880): Sets persist-credentials: false on detect-changes actions/checkout@v7 and passes steps.filter.outputs.* / github.event_name / matrix.language via env: instead of interpolating ${{ ... }} directly inside run: scripts.
  • .github/workflows/run_rc_validation_go_wordcount.yml (#1642–#1645): References workflow env: variables (${RC_TAG}, ${CONTAINER_TAG}, etc.) directly in run: scripts and passes steps.setup_go.outputs.work_dir via step env: instead of ${{ ... }} template expansion.

Verification

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot added build size/s S: 10-49 lines changed labels Nov 25, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review Summary

This PR hardens three GitHub Actions workflows by disabling credential persistence on actions/checkout@v7 and replacing direct ${{ ... }} expression interpolation in run: blocks with environment variables. The changes cleanly resolve the target zizmor/artipacked and zizmor/template-injection alerts without altering workflow semantics.

🔍 General Feedback

  • Passing step outputs and context variables through env: and jq --arg in codeql.yml and run_rc_validation_go_wordcount.yml follows GitHub Actions security best practices.
  • Adding the non-empty prefix check ([[ -n "${WORK_DIR}" && "${WORK_DIR}" == go-rc-test-* ]]) before rm -rf in the always() cleanup step of run_rc_validation_go_wordcount.yml is a solid defensive improvement in case the setup step fails before setting the output.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@derrickaw derrickaw added ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review and removed ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review labels Nov 25, 2026
@derrickaw
derrickaw marked this pull request as ready for review November 25, 2026 21:03
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm for label build.
Backup reviewer: Amar3tto (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@damccorm damccorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@derrickaw
derrickaw merged commit 2c601ba into master Nov 25, 2026
20 checks passed
@derrickaw
derrickaw deleted the codescan/gha-workflow-note-hardening branch November 25, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants