From a5c3c657f3b6380958147542d412e17e3dfb014e Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Sun, 28 Dec 2025 04:07:18 -0800 Subject: [PATCH] feat(release): sync version back to codebase after release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds step 5 to pull version commit from codebase-release back to codebase, keeping VERSION.json in sync automatically. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .husky/post-push | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.husky/post-push b/.husky/post-push index 730fb1b85..f76da0ab9 100755 --- a/.husky/post-push +++ b/.husky/post-push @@ -206,17 +206,30 @@ else fi # ============================================================================= -# STEP 4: Push version commit and tags to remotes +# STEP 4: Push tags to gitlab # ============================================================================= -log_step "Pushing version and tags..." +log_step "Pushing to gitlab..." -# Push version commit back to codebase (so VERSION.json stays in sync) -run_cmd git push origin main || log_warn "Push to codebase failed" - -# Push tags to gitlab (the actual remote) run_cmd git push gitlab main --tags || log_warn "Push to gitlab failed" -log_success "Pushed to remotes" +log_success "Pushed to gitlab" + +# ============================================================================= +# STEP 5: Sync version back to codebase +# ============================================================================= +log_step "Syncing version back to codebase..." + +cd "$CODEBASE_ROOT" +log_info "Working directory: $CODEBASE_ROOT" + +# Pull the version commit from codebase-release +run_cmd git fetch "$RELEASES_ROOT" main +run_cmd git merge FETCH_HEAD --ff-only || { + log_warn "Could not fast-forward merge, manual sync needed" + log_info "Run: cd codebase && git pull ../codebase-release main" +} + +log_success "Codebase synced with version $NEW_VERSION" # ============================================================================= # DONE @@ -227,8 +240,8 @@ if [[ "$DRY_RUN" == "true" ]]; then log_info "Run without --dry-run to execute" else log_header "Release v$NEW_VERSION Complete" - log_info "View release: cd codebase-releases && git log --oneline -1" - log_info "View tag: git show v$NEW_VERSION" + log_info "Codebase VERSION.json updated" + log_info "Tag v$NEW_VERSION pushed to gitlab" fi exit 0