Skip to content

Commit 6f71a64

Browse files
committed
Add GitHub Actions workflow for version bump
1 parent 2c116b0 commit 6f71a64

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/version-bump.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Auto Version Bump
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
7+
jobs:
8+
bump-version:
9+
if: >
10+
github.event.label.name == 'patch' ||
11+
github.event.label.name == 'minor' ||
12+
github.event.label.name == 'major' ||
13+
github.event.label.name == 'release'
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.11"
26+
27+
- name: Run version bump script
28+
run: |
29+
python tools/bump_version.py ${{ github.event.label.name }}
30+
31+
- name: Create Pull Request
32+
uses: peter-evans/create-pull-request@v5
33+
with:
34+
commit-message: "chore: bump version (${{ github.event.label.name }})"
35+
title: "chore: bump version (${{ github.event.label.name }})"
36+
body: |
37+
This version bump was triggered by PR #${{ github.event.pull_request.number }}
38+
Label applied: **${{ github.event.label.name }}**
39+
labels: version-bump
40+
base: main
41+
branch: auto-version-bump/${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)