Skip to content

Commit 0b6cbdb

Browse files
committed
[skip ci]
1 parent a8e51a0 commit 0b6cbdb

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/update-submodules.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Update Submodules
22

33
on:
44
schedule:
5-
- cron: '0 0 * * 0' # Jede Woche, z.B. Sonntags um Mitternacht
5+
- cron: '0 0 * * 0' # Every Sunday at midnight
66
workflow_dispatch:
77

88
jobs:
@@ -23,15 +23,21 @@ jobs:
2323
if [ -n "$(git status --porcelain)" ]; then
2424
echo "Submodule updates found"
2525
26-
# Create a new branch for the changes
2726
BRANCH_NAME="update-submodules-branch"
28-
29-
# Check if branch already exists on the remote
27+
28+
# Delete the remote branch if it exists
3029
if git ls-remote --exit-code --heads origin $BRANCH_NAME; then
31-
echo "Branch $BRANCH_NAME already exists. Exiting."
32-
exit 1
30+
echo "Deleting existing remote branch $BRANCH_NAME"
31+
git push origin --delete $BRANCH_NAME
32+
fi
33+
34+
# Delete the local branch if it exists
35+
if git show-ref --verify --quiet refs/heads/$BRANCH_NAME; then
36+
echo "Deleting existing local branch $BRANCH_NAME"
37+
git branch -D $BRANCH_NAME
3338
fi
3439
40+
# Create a new branch and make changes
3541
git checkout -b $BRANCH_NAME
3642
git add .
3743
git commit -m "Update submodules to latest commits"

0 commit comments

Comments
 (0)