Skip to content

Commit

Permalink
remove existing check
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderDake committed Aug 24, 2023
1 parent ea342e3 commit f45a8a8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/daily-dev-bump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,11 @@ jobs:
run: |
set -x
# Get 5 most recent branches of closed DartDevtoolWorkflowBot PRs.
CLOSED_BRANCH_NAMES=$(gh pr list -A DartDevtoolWorkflowBot -s closed -L 5 --search sort:created-desc | grep auto-bump- | sed 's|.*\(auto-bump-[[:digit:]]*\).*|\1|')
CLOSED_BRANCH_NAMES=$(gh pr list -A DartDevtoolWorkflowBot -s closed -L 10 --search sort:created-desc | grep auto-bump- | sed 's|.*\(auto-bump-[[:digit:]]*\).*|\1|')
# Get list of refs(branches) that exist on the remote
EXISTING_REFS=$(git ls-remote --heads | grep refs/heads/auto-bump-)
for CLOSED_BRANCH in $CLOSED_BRANCH_NAMES; do
if echo "$EXISTING_REFS" | grep -q "$CLOSED_BRANCH" ; then
# If the branch still exists then we will delete it
gh api /repos/flutter/devtools/git/refs/heads/$CLOSED_BRANCH -X DELETE
fi
gh api /repos/flutter/devtools/git/refs/heads/$CLOSED_BRANCH -X DELETE
done
env:
GH_TOKEN: ${{ secrets.DEVTOOLS_WORKFLOW_BOT_TOKEN }}

0 comments on commit f45a8a8

Please sign in to comment.