1
0
mirror of https://github.com/Prowlarr/Indexers.git synced 2025-12-19 18:48:24 +00:00

Fixed: auto-enable force push after commit amend

Added safety protection to prevent force push to master branch
This commit is contained in:
ServarrAdmin
2025-08-19 07:59:24 -05:00
parent e61e29f477
commit 87fde6f89f

View File

@@ -987,6 +987,7 @@ cleanup_and_commit() {
exit 7
fi
log "INFO" "Commit Appended - [$new_commit_msg]"
push_mode_force=true # Auto-enable force push after amend
else
if ! git commit -m "$new_commit_msg"; then
log "ERROR" "Failed to create new commit"
@@ -1008,6 +1009,14 @@ push_changes() {
log "INFO" "Evaluating for Push to Remote"
log "DEBUG" " Push Modes for Branch: $push_branch"
log "DEBUG" "Push To Remote: $push_mode with Force Push With Lease: $push_mode_force"
# Safety check: NEVER force push to master
if [ "$push_mode_force" = true ] && [ "$push_branch" = "master" ]; then
log "ERROR" "Force push to master branch is forbidden for safety"
push_mode_force=false
log "WARN" "Disabled force push - will attempt regular push instead"
fi
if [ "$push_mode" = true ] && [ "$push_mode_force" = true ]; then
if git push "$prowlarr_push_remote" "$push_branch" --force-if-includes --force-with-lease; then
log "WARN" "[$prowlarr_push_remote $push_branch] Branch Force Pushed"