@@ -33,30 +33,26 @@ jobs:
3333 - name : Create/Update version branch
3434 if : github.ref_name == 'main'
3535 run : |
36- # Pełna wersja bota (np. 4.1.0)
3736 FULL_BOT_VERSION=$(node -p "require('./bot/package.json').version")
38-
39- # Wyciągamy major.minor (np. 4.0 lub 4.1) → nazwa brancha
4037 MAJOR_MINOR=$(echo $FULL_BOT_VERSION | cut -d. -f1,2)
4138 BRANCH_NAME="v$MAJOR_MINOR"
4239
4340 echo "Full bot version: $FULL_BOT_VERSION"
4441 echo "Target branch: $BRANCH_NAME"
4542
46- # Sprawdzenie czy branch istnieje w remote
43+ # Jeśli branch istnieje → checkout i commituj zmiany
4744 if git ls-remote --exit-code origin $BRANCH_NAME; then
4845 echo "Branch $BRANCH_NAME exists, updating it..."
46+ git fetch origin $BRANCH_NAME
4947 git checkout $BRANCH_NAME
50- # Kopiowanie aktualnych folderów
51- cp -r bot dbm .
48+ git merge main --ff-only
5249 git add bot dbm
5350 git commit -m "Update bot and dbm for version $FULL_BOT_VERSION" || echo "No changes to commit"
5451 git push origin $BRANCH_NAME
5552 git checkout main
5653 else
5754 echo "Branch $BRANCH_NAME does not exist, creating it..."
5855 git checkout -b $BRANCH_NAME
59- cp -r bot dbm .
6056 git add bot dbm
6157 git commit -m "Create branch for version $FULL_BOT_VERSION"
6258 git push origin $BRANCH_NAME
0 commit comments