From 1a7dad91710227d9bdf2d0349a3c23ac21c099e4 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sun, 4 Oct 2026 10:47:44 +0200 Subject: [PATCH] Skip upgrade check in CI while database version did not change since previous release --- .github/workflows/ci-linux.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index d2b4f39..9c358c1 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -276,7 +276,15 @@ jobs: - name: Find previous release run: | cd galette-core/galette/plugins/plugin-objectslend - echo "PREVIOUS_RELEASE=$(git tag --list '[0-9]*' --sort=-v:refname --no-contains HEAD | head -n1)" >> $GITHUB_ENV + PREVIOUS_RELEASE=$(git tag --list '[0-9]*' --sort=-v:refname --no-contains HEAD | head -n1) + echo "PREVIOUS_RELEASE=$PREVIOUS_RELEASE" >> $GITHUB_ENV + # no upgrade to check while database version is the same as in previous release + dbver() { grep -oE "dbver: *'?[0-9.]+" | grep -oE '[0-9.]+$'; } + previous=$(git show "$PREVIOUS_RELEASE:_define.php" | dbver || true) + current=$(dbver < _define.php) + if [ -z "$previous" ] || awk -v a="$previous" -v b="$current" 'BEGIN { exit !(a + 0 != b + 0) }'; then + echo "DB_CHANGED=1" >> $GITHUB_ENV + fi - name: Install previous release for PostgreSQL env: @@ -298,6 +306,7 @@ jobs: if: startsWith(matrix.db-image, 'mysql') || startsWith(matrix.db-image, 'mariadb') - name: Upgrade + if: env.DB_CHANGED == '1' run: | cd galette-core bin/console galette:plugins:install-db --no-interaction plugin-objectslend | tee upgrade.log