This repository was archived by the owner on Aug 31, 2021. It is now read-only.
File tree 3 files changed +56
-2
lines changed
3 files changed +56
-2
lines changed Original file line number Diff line number Diff line change 15
15
uses : actions/checkout@v2
16
16
with :
17
17
fetch-depth : 0
18
+ -
19
+ name : Check plugin and script version
20
+
21
+ with :
22
+ cmd : ./scripts/check_version.sh plugin.yaml scripts/install_version.sh ${{ github.ref }}
18
23
-
19
24
name : Set up Go
20
25
uses : actions/setup-go@v2
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Checks plugin.yaml version and also the install version script version
4
+
5
+ set -e
6
+
7
+ plugin_yaml=$1
8
+ # example: refs/tags/0.0.1
9
+ install_version_script=$2
10
+ refTag=$3
11
+ expected_version=$( echo $refTag | cut -d " /" -f 3)
12
+
13
+ if [ -z $expected_version ];
14
+ then
15
+ echo " git tag value is empty"
16
+ exit 1
17
+ fi
18
+
19
+ if [ ! -e $plugin_yaml ];
20
+ then
21
+ echo " File $plugin_yaml does not exist!"
22
+ exit 1
23
+ fi
24
+
25
+ plugin_version=$( yq read $plugin_yaml version)
26
+
27
+ if [ " $plugin_version " != " $expected_version " ];
28
+ then
29
+ echo " Plugin version $plugin_version is not the expected version $expected_version "
30
+ exit 1
31
+ fi
32
+
33
+ if [ ! -e $install_version_script ];
34
+ then
35
+ echo " File $install_version_script does not exist!"
36
+ exit 1
37
+ fi
38
+
39
+ set +e
40
+
41
+ grep -q -F $expected_version $install_version_script
42
+ wrong_version=$?
43
+
44
+ set -e
45
+
46
+ if [ $wrong_version != 0 ];
47
+ then
48
+ echo " $install_version_script does not have the right version"
49
+ exit 1
50
+ fi
Original file line number Diff line number Diff line change 7
7
# # version of the plugin mentioned
8
8
# # in the plugin.yaml
9
9
10
- version=" $( cat plugin.yaml | grep " version:" | cut -d ' "' -f 2) "
11
- ./scripts/install.sh $version
10
+ ./scripts/install.sh " 0.0.3"
You can’t perform that action at this time.
0 commit comments