-
Notifications
You must be signed in to change notification settings - Fork 62
45 lines (43 loc) · 1.36 KB
/
pr.yml
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Check PR
on:
pull_request:
branches:
- main
paths-ignore:
- README.md
- ci/**
# - .github/**
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from file
id: get_version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/[email protected]"
- name: Checking for version bump
id: check_vbump
continue-on-error: true
run: |
LAST_TAG="${{ steps.previoustag.outputs.tag }}"
NEW_TAG="v${{ steps.get_version.outputs.version }}"
RESULT=$(ci/assets/checksemver.sh ${NEW_TAG} ${LAST_TAG})
if [ "${RESULT}" == "1" ]; then
echo "msg=Version bump found." >> $GITHUB_OUTPUT
exit 0
elif [ "${RESULT}" == "0" ]; then
echo "msg=Version bump did not happen. ${LAST_TAG} is the same as ${NEW_TAG}" >> $GITHUB_OUTPUT
exit 1
else
echo "msg=Version bump did not happen. ${LAST_TAG} is higher than ${NEW_TAG}" >> $GITHUB_OUTPUT
exit 1
fi
- uses: mshick/[email protected]
if: always()
with:
message: |
${{ steps.check_vbump.outputs.msg }}