fix: release.sh: cd in disinto_release() permanently changes CWD of calling shell (#323) #333

Merged
dev-qwen merged 1 commit from fix/issue-323 into main 2026-04-07 00:17:59 +00:00
Collaborator

Fixes #323

Changes

Fixes #323 ## Changes
dev-qwen added 1 commit 2026-04-07 00:13:33 +00:00
fix: release.sh: cd in disinto_release() permanently changes CWD of calling shell (#323)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
12ca3fe214
Collaborator

AI Review

Summary

The fix wraps the cd "$ops_root" block and all subsequent git operations in a subshell (...). This is the standard bash idiom for scoping directory changes — the cd affects only the subshell environment, so the caller's CWD is unchanged after the function returns.

Correctness

  • Subshell exit propagation: exit 1 inside the subshell exits the subshell with code 1. With set -euo pipefail active in the parent, the non-zero subshell exit correctly propagates and aborts the function. Error handling is preserved.
  • Vault file creation: The vault TOML is written at an absolute path before the subshell runs (line 91). The subshell then stages and commits it. Ordering is correct.
  • 2>/dev/null || true on git commit: Unchanged from before; allows no-op commits without failing.
  • git push to local forge: Not an external action per policy — local forge operations with FORGE_TOKEN are explicitly excepted from vault dispatch.

Checklist

  • ShellCheck: No new quoting or pipefail issues introduced.
  • No dead code, no security concerns, no unquoted variables.
  • Change is minimal and scoped exactly to the bug.

Verdict

APPROVE — Subshell wrapping correctly contains the cd, preserving caller CWD without changing behavior


Reviewed at 12ca3fe | AGENTS.md

## AI Review <!-- reviewed: 12ca3fe214c5c44e03151c1f106851c0a435cd5f --> ### Summary The fix wraps the `cd "$ops_root"` block and all subsequent git operations in a subshell `(...)`. This is the standard bash idiom for scoping directory changes — the `cd` affects only the subshell environment, so the caller's CWD is unchanged after the function returns. ### Correctness - **Subshell exit propagation**: `exit 1` inside the subshell exits the subshell with code 1. With `set -euo pipefail` active in the parent, the non-zero subshell exit correctly propagates and aborts the function. Error handling is preserved. - **Vault file creation**: The vault TOML is written at an absolute path before the subshell runs (line 91). The subshell then stages and commits it. Ordering is correct. - **`2>/dev/null || true` on git commit**: Unchanged from before; allows no-op commits without failing. - **git push to local forge**: Not an external action per policy — local forge operations with `FORGE_TOKEN` are explicitly excepted from vault dispatch. ### Checklist - ShellCheck: No new quoting or pipefail issues introduced. - No dead code, no security concerns, no unquoted variables. - Change is minimal and scoped exactly to the bug. ### Verdict **APPROVE** — Subshell wrapping correctly contains the cd, preserving caller CWD without changing behavior --- *Reviewed at `12ca3fe` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-07 00:17:42 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Subshell wrapping correctly contains the cd, preserving caller CWD without changing behavior

AI Review: **APPROVE** — Subshell wrapping correctly contains the cd, preserving caller CWD without changing behavior
dev-qwen merged commit fcd892dce0 into main 2026-04-07 00:17:59 +00:00
dev-qwen deleted branch fix/issue-323 2026-04-07 00:18:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#333
No description provided.