You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix git-clone module to fail fast when pre_clone_script or post_clone_script returns a non-zero exit code. Previously, both scripts were executed but their exit codes were never checked — a failing pre-clone hook (e.g., a prerequisite check that calls exit 1) was silently ignored and cloning continued. This broke the advertised "validate prerequisites before cloning" behavior and could leave workspaces starting with unmet preconditions.
Type of Change
New module
New template
Bug fix
Feature/enhancement
Documentation
Other
Module Information
Path:registry/coder/modules/git-clone New version:v1.3.1 Breaking change: [ ] Yes [x] No
Hey, thanks for looking into this! The root cause here is actually that run.sh is missing set -euo pipefail at the top, which most of our newer modules already use (claude-code, aider, amazon-q, agent-firewall, dotfiles, etc.). Adding that one line would make the manual if ! guards unnecessary since the script would automatically exit on any non-zero return, and it'd also catch other silent failures we're not handling today (like git clone itself failing, or the base64 -d pipe breaking).
@ikkz Would you be open to swapping the approach to just add set -euo pipefail at the top instead? Smaller diff, catches more cases, and brings this module in line with the rest of the registry.
Added set -euo pipefail to run.sh instead of manually checking the pre/post-clone script exit codes, and added regression tests for failing pre/post-clone hooks.
Also, once this PR is merged, when should we expect the new git-clone module version (v1.3.1) to be published?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix git-clone module to fail fast when
pre_clone_scriptorpost_clone_scriptreturns a non-zero exit code. Previously, both scripts were executed but their exit codes were never checked — a failing pre-clone hook (e.g., a prerequisite check that callsexit 1) was silently ignored and cloning continued. This broke the advertised "validate prerequisites before cloning" behavior and could leave workspaces starting with unmet preconditions.Type of Change
Module Information
Path:
registry/coder/modules/git-cloneNew version:
v1.3.1Breaking change: [ ] Yes [x] No
Testing & Validation
bun test)bun fmt)Related Issues