File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ declare PATCH=false
4
+ declare MINOR=false
5
+ declare MAJOR=false
6
+ declare rc=0
7
+
8
+ git log $( git describe --tags --abbrev=0) ..HEAD --oneline | tee /tmp/release-changelogs.txt
9
+
10
+ if [[ $( cat /tmp/release-changelogs.txt | grep fix) || $( cat /tmp/release-changelogs.txt | grep patch) ]]; then
11
+ PATCH=true
12
+ fi
13
+
14
+ if [[ $( cat /tmp/release-changelogs.txt | grep feat) ]]; then
15
+ MINOR=true
16
+ fi
17
+
18
+ for f in $( find api) ; do
19
+ git diff --exit-code " ${f} "
20
+ if [ $? -eq 1 ]; then
21
+ echo " Found changes on api dir at ${f} "
22
+ rc=1
23
+ exit 1
24
+ fi
25
+ done
26
+
27
+ if [ $rc -eq 1 ]; then
28
+ MAJOR=true
29
+ fi
30
+
31
+ echo -e " \n"
32
+ echo -e " ================================================================================="
33
+
34
+ if [[ $MAJOR == false && $MINOR == false ]]; then
35
+ echo " Release type: patch"
36
+ elif [[ $MAJOR == false && $MINOR == true ]]; then
37
+ echo " Release type: minor"
38
+ else
39
+ echo " Release type: major"
40
+ fi
You can’t perform that action at this time.
0 commit comments