Skip to content

Commit b3f2f4f

Browse files
committed
...
1 parent e9d622a commit b3f2f4f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

.github/workflows/build_releases.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)