• And cleanup:

    #!/bin/bash
    
    set -euo pipefail
    IFS=$'\n\t'
    
    PREFIX="ci-check-"
    
    git for-each-ref --format='%(refname:short)' "refs/heads/${PREFIX}*" | while IFS= read -r branch_name; do
      git branch -D "$branch_name"
    done
    
    git for-each-ref --format='%(refname:short)' "refs/remotes/origin/${PREFIX}*" | sed "s|^origin/||" | while IFS= read -r branch_name; do
      git push origin --delete "$branch_name"
    done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment