Check the WCF_VERSION only if the result might have changed
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 31 May 2022 14:30:03 +0000 (16:30 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 31 May 2022 14:30:03 +0000 (16:30 +0200)
.github/workflows/misc.yml [deleted file]
.github/workflows/version_check.yml [new file with mode: 0644]

diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml
deleted file mode 100644 (file)
index a1618c7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-name: Misc
-
-on:
-  push:
-    branches:
-    - "[0-9]+.[0-9]+"
-    - master
-
-jobs:
-  wcf_version:
-    name: "Check that WCF_VERSION is in sync"
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@v3
-    - run: |
-        set -x
-        PACKAGE_VERSION="$(sed '/<version>/!d;s!^.*<version>!!;s!</version>$!!' com.woltlab.wcf/package.xml)"
-        WCF_VERSION="$(sed -r '/WCF_VERSION/!d;s!^.?define..WCF_VERSION., .!!;s!..;$!!' wcfsetup/install/files/lib/system/WCF.class.php)"
-        if [ "$PACKAGE_VERSION" != "$WCF_VERSION" ]; then
-          echo "::error file=com.woltlab.wcf/package.xml,line=$(awk '/<version>/{print NR}' com.woltlab.wcf/package.xml),title=Mismatching WCF version::This version $PACKAGE_VERSION does not match WCF.class.php."
-          echo "::error file=wcfsetup/install/files/lib/system/WCF.class.php,line=$(awk '/WCF_VERSION/{print NR}' wcfsetup/install/files/lib/system/WCF.class.php),title=Mismatching WCF version::This version $WCF_VERSION does not match package.xml."
-          exit 1
-        fi
diff --git a/.github/workflows/version_check.yml b/.github/workflows/version_check.yml
new file mode 100644 (file)
index 0000000..27bffae
--- /dev/null
@@ -0,0 +1,23 @@
+name: Version Check
+
+on:
+  push:
+    paths:
+    - 'com.woltlab.wcf/package.xml'
+    - 'wcfsetup/install/files/lib/system/WCF.class.php'
+
+jobs:
+  wcf_version:
+    name: "Check that WCF_VERSION is in sync"
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v3
+    - run: |
+        set -x
+        PACKAGE_VERSION="$(sed '/<version>/!d;s!^.*<version>!!;s!</version>$!!' com.woltlab.wcf/package.xml)"
+        WCF_VERSION="$(sed -r '/WCF_VERSION/!d;s!^.?define..WCF_VERSION., .!!;s!..;$!!' wcfsetup/install/files/lib/system/WCF.class.php)"
+        if [ "$PACKAGE_VERSION" != "$WCF_VERSION" ]; then
+          echo "::error file=com.woltlab.wcf/package.xml,line=$(awk '/<version>/{print NR}' com.woltlab.wcf/package.xml),title=Mismatching WCF version::This version $PACKAGE_VERSION does not match WCF.class.php."
+          echo "::error file=wcfsetup/install/files/lib/system/WCF.class.php,line=$(awk '/WCF_VERSION/{print NR}' wcfsetup/install/files/lib/system/WCF.class.php),title=Mismatching WCF version::This version $WCF_VERSION does not match package.xml."
+          exit 1
+        fi