Selaa lähdekoodia

Merge branch 'feature/action-version-match' into hotfix/v21.4.1

Daniel Gibbs 4 vuotta sitten
vanhempi
commit
9a1cc09c87
2 muutettua tiedostoa jossa 37 lisäystä ja 0 poistoa
  1. 14 0
      .github/workflows/version-check.sh
  2. 23 0
      .github/workflows/version-check.yml

+ 14 - 0
.github/workflows/version-check.sh

@@ -0,0 +1,14 @@
+version=$(grep "version=" linuxgsm.sh | sed -e 's/version//g'| tr -d '="')
+modulesversion=$(grep "modulesversion=" lgsm/functions/core_functions.sh | sed -e 's/modulesversion//g'| tr -d '="')
+
+if [ "${version}" != "${modulesversion}" ]; then
+	echo "Error! LinuxGSM version mismatch"
+	echo "Version: ${version}"
+	echo "Modules Version: ${modulesversion}"
+	exit 1
+else
+	echo "Success! LinuxGSM version match"
+	echo "Version: ${version}"
+	echo "Modules Version: ${modulesversion}"
+	exit
+fi

+ 23 - 0
.github/workflows/version-check.yml

@@ -0,0 +1,23 @@
+# This is a basic workflow to help you get started with Actions
+
+name: Version Check
+
+# Controls when the action will run. Triggers the workflow on push or pull request
+# events but only for the master branch
+on: push
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+  # This workflow contains a single job called "build"
+  Version-Check:
+    # The type of runner that the job will run on
+    runs-on: ubuntu-latest
+
+    # Steps represent a sequence of tasks that will be executed as part of the job
+    steps:
+    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+    - uses: actions/checkout@v2
+ 
+    # Runs a single command using the runners shell
+    - name: compare versions
+      run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh