File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Update Submodules
2
2
3
3
on :
4
4
schedule :
5
- - cron : ' 0 0 * * 0' # Jede Woche, z.B. Sonntags um Mitternacht
5
+ - cron : ' 0 0 * * 0' # Every Sunday at midnight
6
6
workflow_dispatch :
7
7
8
8
jobs :
@@ -23,15 +23,21 @@ jobs:
23
23
if [ -n "$(git status --porcelain)" ]; then
24
24
echo "Submodule updates found"
25
25
26
- # Create a new branch for the changes
27
26
BRANCH_NAME="update-submodules-branch"
28
-
29
- # Check if branch already exists on the remote
27
+
28
+ # Delete the remote branch if it exists
30
29
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
33
38
fi
34
39
40
+ # Create a new branch and make changes
35
41
git checkout -b $BRANCH_NAME
36
42
git add .
37
43
git commit -m "Update submodules to latest commits"
You can’t perform that action at this time.
0 commit comments