chore: delete the release branch after a bugfix release (#32395)

This commit is contained in:
andig 2026-08-01 14:18:37 +02:00 • committed by GitHub
parent b9a1a94726
commit b8a440e5ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 39 additions and 0 deletions

View file

@ -204,3 +204,38 @@ jobs:
git config user.email github-actions@github.com
git commit -am "Mirror evcc release"
git push
cleanup:
name: Delete Release Branch
needs:
- docker
- apt
runs-on: depot-ubuntu-24.04-arm
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: true
# a bugfix release consumes its release branch, e.g. tag 0.313.1 is the tip
# of release/0.313.1. Feature releases have no such branch.
- env:
TAG: ${{ github.ref_name }}
run: |
branch="release/$TAG"
head=$(git rev-parse --verify --quiet "origin/$branch") || {
echo "::notice::no $branch to delete"
exit 0
}
if [ "$head" != "$(git rev-parse "$TAG^{commit}")" ]; then
echo "::notice::$branch moved past $TAG, keeping it"
exit 0
fi
git push origin --delete "$branch"