Skip to content

Commit f1c0e5b

Browse files
fix: add condition to create release
1 parent d036463 commit f1c0e5b

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

.github/workflows/bump-and-release.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
name: Bump Version and Create Release
22

3-
# คำอธิบายการ bump version (ภาษาไทย)
4-
#
5-
# กฎการ bump:
6-
# - Merge เข้า `main`:
7-
# - ถ้า source branch ขึ้นต้นด้วย `fix/` หรือ `hotfix/` -> bump patch: vMAJOR.MINOR.(PATCH+1)
8-
# - มิฉะนั้น -> bump minor: vMAJOR.(MINOR+1).0
9-
# - Merge เข้า `development`:
10-
# - สร้าง/เพิ่ม pre-release บนฐานเวอร์ชันปัจจุบัน: vMAJOR.MINOR.PATCH-dev.N
11-
# - ถ้า source branch ขึ้นต้นด้วย `fix/` จะเพิ่ม suffix patch: vMAJOR.MINOR.PATCH-dev.N-patch.M
12-
#
13-
# วิธีตรวจหาเวอร์ชันปัจจุบัน:
14-
# - จะตรวจ `git tags` ก่อน (รวม pre-release tags เช่น v0.2.0-dev.2)
15-
# - ถ้าไม่มี tags จะ fallback ไปใช้ GitHub Releases API
16-
# - ก่อนสร้าง tag ใหม่ workflow จะตรวจให้แน่ใจว่า tag นั้นยังว่างอยู่ (increment counters จนไม่ซ้ำ)
17-
#
18-
# หมายเหตุ:
19-
# - เพื่อให้ workflow ทำงานถูกต้อง ควรมี tags ถูก push ขึ้น remote (หรือ workflow ต้องมีสิทธิ์ fetch tags)
20-
# - หากต้องการทดสอบ locally ให้ clone repo และ `git fetch --tags` เพื่อให้มีข้อมูล tags ครบ
21-
223
on:
234
pull_request:
245
types: closed
@@ -176,6 +157,7 @@ jobs:
176157
177158
- name: Create GitHub Release
178159
uses: softprops/action-gh-release@v2
160+
if: github.event.pull_request.base.ref == "main"
179161
env:
180162
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
181163
with:

0 commit comments

Comments
 (0)