-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.3 KB
/
check-version-increment.yaml
File metadata and controls
38 lines (36 loc) · 1.3 KB
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
name: "Check version increment"
on:
pull_request:
branches:
- main
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout new
uses: actions/checkout@v4
with:
path: new
- name: Checkout old
uses: actions/checkout@v4
with:
path: old
ref: refs/heads/main
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Download script
run: |
curl --silent --output check-version-increment.sh \
https://gitlab.com/madebyTimo/scripts-development/-/raw/main/scripts/\
check-version-increment.sh \
&& chmod +x check-version-increment.sh
- name: Test version increment
run: |
BRANCH="${GITHUB_HEAD_REF#/ref/head}"
echo "Branch to check: $BRANCH"
if [[ "$BRANCH" == @(feature|bugfix)/* ]]; then
./check-version-increment.sh --file --new new/Version.txt \
--old old/Version.txt
else
[[ $(cat new/Version.txt) == $(cat old/Version.txt) ]]
fi