Skip to content

Commit

Permalink
feat: test
Browse files Browse the repository at this point in the history
  • Loading branch information
jiumos committed Sep 13, 2024
1 parent ea8b885 commit b88d668
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/clear-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down

0 comments on commit b88d668

Please sign in to comment.