Commit ba92717fe64e
Changed files (1)
tools
nix-flake-update
tools/nix-flake-update/nix-flake-update.sh
@@ -194,58 +194,56 @@ Built systems: $BUILD_SYSTEMS
git commit -m "$COMMIT_MSG"
- if [ "$DRY_RUN" = "false" ]; then
- if [ "$AUTO_MERGE" = "true" ]; then
- # Auto-merge: rebase onto main and push directly
- log "Auto-merge enabled: rebasing onto $GIT_REMOTE/$MAIN_BRANCH"
-
- # Fetch latest main
- git fetch "$GIT_REMOTE" "$MAIN_BRANCH"
-
- # Rebase our commit onto main
- if git rebase "$GIT_REMOTE/$MAIN_BRANCH"; then
- log "Rebase successful, pushing to $GIT_REMOTE/$MAIN_BRANCH"
-
- # Push directly to main
- git push "$GIT_REMOTE" "HEAD:$MAIN_BRANCH"
-
- # Notify success
- notify "default" "✅ Flake Auto-Updated & Merged" \
- "Updates for $input_desc merged to $MAIN_BRANCH. All builds passed: $BUILD_SYSTEMS" \
- "white_check_mark,flake,merged"
-
- log "SUCCESS: Flake updated and merged to $MAIN_BRANCH"
- else
- log "ERROR: Rebase failed, main branch may have moved"
- git rebase --abort || true
-
- add_todo_to_inbox "Flake update rebase conflict" \
- "Auto-merge failed due to rebase conflict.
-Inputs: $input_desc
-Branch: $BRANCH_NAME (in worktree, needs manual rebase)"
-
- notify "high" "⚠️ Flake Update Rebase Failed" \
- "Could not rebase $input_desc onto $MAIN_BRANCH. TODO added to inbox." \
- "warning,flake,conflict"
- exit 1
- fi
- else
- # Branch mode: push to feature branch
- log "Pushing to $GIT_REMOTE/$BRANCH_NAME"
- git push "$GIT_REMOTE" "$BRANCH_NAME"
-
- # Notify success
- notify "default" "✅ Flake Updated Successfully" \
- "Branch $BRANCH_NAME created and pushed. All builds passed: $BUILD_SYSTEMS" \
- "white_check_mark,flake"
-
- log "SUCCESS: Flake updated and pushed to $BRANCH_NAME"
- fi
- else
+ if [ "$DRY_RUN" != "false" ] && [ "$DRY_RUN" != "" ] && [ "$DRY_RUN" != "0" ]; then
log "DRY RUN: Would push to $GIT_REMOTE/$BRANCH_NAME"
notify "low" "🧪 Flake Update (Dry Run)" \
"Branch $BRANCH_NAME created locally. All builds passed: $BUILD_SYSTEMS" \
"test_tube,flake"
+ elif [ "$AUTO_MERGE" = "true" ] || [ "$AUTO_MERGE" = "1" ]; then
+ # Auto-merge: rebase onto main and push directly
+ log "Auto-merge enabled: rebasing onto $GIT_REMOTE/$MAIN_BRANCH"
+
+ # Fetch latest main
+ git fetch "$GIT_REMOTE" "$MAIN_BRANCH"
+
+ # Rebase our commit onto main
+ if git rebase "$GIT_REMOTE/$MAIN_BRANCH"; then
+ log "Rebase successful, pushing to $GIT_REMOTE/$MAIN_BRANCH"
+
+ # Push directly to main
+ git push "$GIT_REMOTE" "HEAD:$MAIN_BRANCH"
+
+ # Notify success
+ notify "default" "✅ Flake Auto-Updated & Merged" \
+ "Updates for $input_desc merged to $MAIN_BRANCH. All builds passed: $BUILD_SYSTEMS" \
+ "white_check_mark,flake,merged"
+
+ log "SUCCESS: Flake updated and merged to $MAIN_BRANCH"
+ else
+ log "ERROR: Rebase failed, main branch may have moved"
+ git rebase --abort || true
+
+ add_todo_to_inbox "Flake update rebase conflict" \
+ "Auto-merge failed due to rebase conflict.
+Inputs: $input_desc
+Branch: $BRANCH_NAME (in worktree, needs manual rebase)"
+
+ notify "high" "⚠️ Flake Update Rebase Failed" \
+ "Could not rebase $input_desc onto $MAIN_BRANCH. TODO added to inbox." \
+ "warning,flake,conflict"
+ exit 1
+ fi
+ else
+ # Branch mode: push to feature branch
+ log "Pushing to $GIT_REMOTE/$BRANCH_NAME"
+ git push "$GIT_REMOTE" "$BRANCH_NAME"
+
+ # Notify success
+ notify "default" "✅ Flake Updated Successfully" \
+ "Branch $BRANCH_NAME created and pushed. All builds passed: $BUILD_SYSTEMS" \
+ "white_check_mark,flake"
+
+ log "SUCCESS: Flake updated and pushed to $BRANCH_NAME"
fi
else