From 31b9e61adb212a042f1f34674bffb749dc08b60c Mon Sep 17 00:00:00 2001 From: ArthurErlich Date: Mon, 21 Sep 2026 18:37:10 +0200 Subject: [PATCH 1/2] ci: add pre-merge version-and-changelog check for PRs into main --- .gitea/workflows/pr-version-check.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .gitea/workflows/pr-version-check.yml diff --git a/.gitea/workflows/pr-version-check.yml b/.gitea/workflows/pr-version-check.yml new file mode 100644 index 0000000..3f5a2d8 --- /dev/null +++ b/.gitea/workflows/pr-version-check.yml @@ -0,0 +1,40 @@ +name: version-changelog + +on: + pull_request: + branches: [main] + +jobs: + version-changelog: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check version bump and changelog entry + run: | + set -e + PR_VERSION=$(grep -m1 '"version"' composer.json | sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/') + MAIN_VERSION=$(git show origin/main:composer.json | grep -m1 '"version"' | sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/') + + echo "main version: $MAIN_VERSION" + echo "PR version: $PR_VERSION" + + if [ "$MAIN_VERSION" = "$PR_VERSION" ]; then + echo "::error::composer.json version ($PR_VERSION) was not bumped from main ($MAIN_VERSION)" + exit 1 + fi + + HIGHEST=$(printf '%s\n%s\n' "$MAIN_VERSION" "$PR_VERSION" | sort -V | tail -n1) + if [ "$HIGHEST" != "$PR_VERSION" ]; then + echo "::error::composer.json version ($PR_VERSION) is not greater than main's ($MAIN_VERSION)" + exit 1 + fi + + if ! grep -qF "## [$PR_VERSION]" CHANGELOG.md; then + echo "::error::CHANGELOG.md is missing a '## [$PR_VERSION]' heading" + exit 1 + fi + + echo "OK: version bumped to $PR_VERSION and documented in CHANGELOG.md" -- 2.54.0 From 4e5464c47c0d4740d65f218dfae23fb21c20fae9 Mon Sep 17 00:00:00 2001 From: ArthurErlich Date: Mon, 21 Sep 2026 18:39:51 +0200 Subject: [PATCH 2/2] test: demonstrate the pre-merge check passing (not for merge) --- CHANGELOG.md | 6 ++++++ composer.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb34e0..b721954 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to AeonDumpManager will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.2] - 2026-09-21 + +### Added + +- Demo entry to verify the pre-merge version-and-changelog check passes. + ## [Unreleased] ### Added diff --git a/composer.json b/composer.json index 9d7c2ac..adc23b7 100755 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Export database dumps for Shopware 6 environments.", "type": "shopware-platform-plugin", "license": "MIT", - "version": "0.0.1", + "version": "0.0.2", "keywords": [ "shopware", "shopware6", -- 2.54.0