-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (24 loc) · 859 Bytes
/
ci.yml
File metadata and controls
29 lines (24 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: CI
on:
push:
branches: [master, main]
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check version bump on main
run: |
if [ "${{ github.event.repository.default_branch }}" = "${{ github.ref_name }}" ]; then
CURRENT_VERSION=$(cat VERSION)
PREV_VERSION=$(git show HEAD~1:VERSION 2>/dev/null || echo "")
if [ "$CURRENT_VERSION" = "$PREV_VERSION" ]; then
echo "Error: VERSION file must be bumped on push to main branch"
echo "Current version: $CURRENT_VERSION"
echo "Previous version: $PREV_VERSION"
exit 1
fi
echo "Version bump verified: $PREV_VERSION -> $CURRENT_VERSION"
fi