Skip to content

Fix shell variable expansion in release workflow - #2149

Merged
moshemorad merged 2 commits into
masterfrom
claude/untrusted-pr-body-eval-n88nwg
Aug 16, 2026
Merged

Fix shell variable expansion in release workflow#2149
moshemorad merged 2 commits into
masterfrom
claude/untrusted-pr-body-eval-n88nwg

Conversation

@moshemorad

Copy link
Copy Markdown
Contributor

Summary

Updated the release workflow to use double quotes instead of single quotes for environment variable expansion in shell commands. This ensures that $RELEASE_VER and other variables are properly interpolated at runtime rather than being treated as literal strings.

Key Changes

  • Changed sed commands from single quotes to double quotes to enable proper variable expansion of $RELEASE_VER
  • Updated skaffold build command to use double quotes for the --tag parameter
  • Added quotes around Docker image tag to properly handle variable expansion
  • Added quotes around Helm chart filename and OCI registry path for consistency and proper variable expansion

Implementation Details

The changes follow shell scripting best practices by using double quotes when variable expansion is needed. This ensures that environment variables set earlier in the workflow (like RELEASE_VER) are correctly substituted into commands rather than being passed as literal $RELEASE_VER strings, which would cause version updates and deployments to fail.

https://claude.ai/code/session_01QCBS4ZhVcGUzibiHGxTGVc

Same defect robusta-gitops fixed in ROB-1034, found by sweeping this
session's repos. release.yaml pasted ${{env.RELEASE_VER}} into four run:
blocks, so the release tag was substituted into the shell source before
bash parsed it. Cutting a release needs write access, so this is defence
in depth rather than an open hole.

RELEASE_VER is already a workflow-level env var, so it is exported to every
step's shell -- the fix is just to reference $RELEASE_VER directly instead
of re-interpolating it, and to quote it.

new-contributors-autoreply.yaml and docker-build-pr.yaml were checked and
need no change: the former posts a static message with no run: block, and
the latter's head.repo.full_name is constrained to GitHub's owner/repo
charset, which has no shell metacharacters.

## Tests performed
- Extracted the shipped "Update package version" run: block from
  release.yaml and ran it against sample _version.py, Chart.yaml,
  values.yaml and pyproject.toml: RELEASE_VER=1.2.3 rewrites all four
  exactly as before, including the quoted pyproject version.
- Ran the same block with RELEASE_VER='$(touch PWNED)': sed exits non-zero,
  no file is modified, and no command executes.
- Confirmed all five workflows still parse as YAML and that no github.* or
  env.* interpolation remains in any run: block in the repo.
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown

Docker image ready for 0784753 (built in 2m 16s)

⚠️ Warning: does not support ARM (ARM images are built on release only - not on every PR)

Use this tag to pull the image for testing.

📋 Copy commands

⚠️ Temporary images are deleted after 30 days. Copy to a permanent registry before using them:

gcloud auth configure-docker us-central1-docker.pkg.dev
docker pull us-central1-docker.pkg.dev/robusta-development/temporary-builds/robusta-runner:0784753
docker tag us-central1-docker.pkg.dev/robusta-development/temporary-builds/robusta-runner:0784753 me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:0784753
docker push me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:0784753

Patch Helm values in one line:

helm upgrade --install robusta robusta/robusta \
  --reuse-values \
  --set runner.image=me-west1-docker.pkg.dev/robusta-development/development/robusta-runner-dev:0784753

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6381bf69-5242-4899-816e-4d5b09686678

📥 Commits

Reviewing files that changed from the base of the PR and between 4847afb and ad5c10e.

📒 Files selected for processing (1)
  • .github/workflows/release.yaml

Included review availability: 4 reviews are currently available. Based on recent review activity, included reviews refill at 5 per hour.


Walkthrough

The release workflow now uses the shell variable RELEASE_VER for package version updates, Skaffold tags, Docker image tags, and Helm chart pushes. The Helm filename and registry destination are quoted.

Changes

Release workflow

Layer / File(s) Summary
Release version command updates
.github/workflows/release.yaml
Release commands use $RELEASE_VER. The Helm chart filename and OCI registry destination are quoted.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to ad5c1

This localized workflow change enables release variables to expand correctly in shell commands; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description accurately explains the release workflow changes and the runtime expansion of RELEASE_VER.
Title check ✅ Passed The title clearly and concisely describes the main change to shell variable expansion in the release workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/untrusted-pr-body-eval-n88nwg

Comment @coderabbitai help to get the list of available commands.

@moshemorad
moshemorad merged commit acf0db9 into master Aug 16, 2026
5 checks passed
@moshemorad
moshemorad deleted the claude/untrusted-pr-body-eval-n88nwg branch August 16, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants