diff --git a/.github/workflows/clear-branch.yml b/.github/workflows/clear-branch.yml index 07cc90bcc39..cd48bdbd37c 100644 --- a/.github/workflows/clear-branch.yml +++ b/.github/workflows/clear-branch.yml @@ -3,6 +3,9 @@ name: Clear Branch on: schedule: - cron: '0 8 * * *' # Runs every day at 0:00 Beijing Time (8:00 UTC) + push: + branches: + - feature-ci workflow_dispatch: inputs: ref: @@ -26,6 +29,7 @@ jobs: git fetch --prune current_branch=$(git rev-parse --abbrev-ref HEAD) protected_branches=$(gh api /repos/${{ github.repository }}/branches --jq '.[] | select(.protected == true) | .name' | tr '\n' ' ') + echo "All protected branch: ${protected_branches}" for branch in $(git branch -r | sed 's/origin\///'|grep -v origin); do if [[ " ${protected_branches[@]} " =~ " ${branch} " ]]; then echo "Skipping protected branch: $branch"