Skip to content

Commit 2c87928

Browse files
committed
ci: version bump flow updated
1 parent 87e341f commit 2c87928

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

.github/workflows/version-bump.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,30 @@ jobs:
4242
run: |
4343
NEW_VERSION=$(pnpm version ${{ inputs.release_type }} --no-git-tag-version | awk '{print $NF}')
4444
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
45+
echo "New version: $NEW_VERSION"
4546
46-
- name: Create new branch
47-
run: |
48-
git checkout -b release/${{ env.new_version }}
49-
50-
- name: Commit & Push changes
47+
- name: Commit version bump
5148
run: |
5249
git config user.name "github-actions[bot]"
5350
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
5451
git add package.json pnpm-lock.yaml
52+
if git diff --cached --quiet; then
53+
echo "⚠️ No version bump changes detected. Skipping commit."
54+
exit 0
55+
fi
5556
git commit -m "chore(release): bump version to ${{ env.new_version }}"
56-
git push origin release/${{ env.new_version }}
5757
58-
# --- DEBUGGING STEPS START ---
59-
- name: Debug Git Status after Push
60-
run: git status
58+
- name: Create release branch
59+
run: |
60+
git checkout -b release/${{ env.new_version }}
61+
git push origin release/${{ env.new_version }}
6162
62-
- name: Debug Git Log after Push
63-
run: git log -n 5
64-
# --- DEBUGGING STEPS END ---
63+
- name: Check if branch has differences
64+
run: |
65+
if git diff origin/main..HEAD --quiet; then
66+
echo "⚠️ No changes detected between main and release/${{ env.new_version }}. Skipping PR."
67+
exit 0
68+
fi
6569
6670
- name: Create Pull Request
6771
run: |
@@ -71,9 +75,8 @@ jobs:
7175
--title "Release: ${{ env.new_version }}" \
7276
--body "Auto-generated release PR for version ${{ env.new_version }}"
7377
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7579

7680
- name: Notify about Major Release (if major)
7781
if: inputs.release_type == 'major'
78-
run: |
79-
echo "🚨 Major version update detected! Please review and merge manually."
82+
run: echo "🚨 Major version update detected! Please review carefully."

0 commit comments

Comments
 (0)