Skip to content

Use randomized delimiter when writing GITHUB_ENV in setup-action - #41675

Open
derrickaw wants to merge 1 commit into
masterfrom
codescan/gha-setup-action-github-env
Open

derrickaw wants to merge 1 commit into
masterfrom
codescan/gha-setup-action-github-env

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 16:45 UTC): 16 PRs merged so far, with ~18 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 1 High-severity GitHub Code Scanning alert (#162, zizmor/github-env) in .github/actions/setup-action/action.yml:

  • zizmor/github-env: Writes KUBELET_GCLOUD_CONFIG_PATH to "${GITHUB_ENV}" using a randomized multiline heredoc delimiter (BEAM_EOF_${RANDOM}_${RANDOM}_$$) instead of an unquoted single-line echo ... >> $GITHUB_ENV append, preventing multiline environment injection if POD_UID ever contains newlines.

Verification

  • zizmor --config .github/zizmor.yml .github/actions/setup-action/action.yml (0 findings)
  • ./gradlew :beam-test-gha:preCommit (BUILD SUCCESSFUL)
  • Live PreCommit GHA workflow run on this PR (exercising ./.github/actions/setup-action in Setup repository): https://github.com/apache/beam/actions/runs/45655305222 (SUCCESS)

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot added the size/xs XS: <10 lines changed label 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 updates .github/actions/setup-action/action.yml to use a randomized delimiter when writing KUBELET_GCLOUD_CONFIG_PATH to GITHUB_ENV. The change cleanly resolves the zizmor/github-env code scanning alert while preserving existing composite action behavior.

🔍 General Feedback

  • Proper use of a randomized multiline delimiter (BEAM_EOF_${RANDOM}_${RANDOM}_$$), quoted "${GITHUB_ENV}" redirection, and safe parameter expansion (${POD_UID:-}).
  • No issues found; looks good to merge.

💡 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 16:51
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @tvalentyn added as fallback since no labels match configuration
Backup reviewer: damccorm (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).

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.

1 participant