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