From 0aa753a4a0029c2f7125a90479b5f6227b870f38 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 e7dba91..37e457e 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -279,7 +279,15 @@ jobs: - name: Find previous release run: | cd galette-core/galette/plugins/plugin-auto - 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: @@ -301,6 +309,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-auto | tee upgrade.log