From e17944d883068a3af33f0ee32b9c941faafa6acf Mon Sep 17 00:00:00 2001 From: Ollama Date: Wed, 8 Apr 2026 10:11:45 +0000 Subject: [PATCH] fix: address all review comments and restore issue template version update - Add issue template version update back with correct 'OpenSourcePOS' casing - Fix version list inconsistency (add 3.3.8 to feature_request.yml, align with bug report.yml) - Fix changelog special characters issue by using temp file instead of inline sed - Keep versions in sync between both templates --- .github/ISSUE_TEMPLATE/feature_request.yml | 3 +- .github/workflows/release.yml | 39 +++++++++++++++++++--- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 3df9b880f..16714eb90 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -42,11 +42,12 @@ body: label: 📦 OpenSourcePOS Version description: What version are you currently running? options: + - development (unreleased) - OpenSourcePOS 3.4.2 - OpenSourcePOS 3.4.1 - OpenSourcePOS 3.4.0 - OpenSourcePOS 3.3.9 - - development (unreleased) + - OpenSourcePOS 3.3.8 default: 0 validations: required: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8cbe76591..de5582582 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -118,17 +118,48 @@ jobs: # Update [unreleased] link to start from new version sed -i "s|^\[unreleased\]: .*|\[unreleased\]: https://github.com/opensourcepos/opensourcepos/compare/${NEW_VERSION}...HEAD|" "$CHANGELOG_FILE" - # Create version header and content + # Create version header and content using temp file to avoid sed issues with special characters VERSION_DATE=$(date +%Y-%m-%d) VERSION_HEADER="## [$NEW_VERSION] - $VERSION_DATE" - # Insert new version section after unreleased header - sed -i "/^## \[Unreleased\]/a \\\n$VERSION_HEADER\n\n$COMMITS" "$CHANGELOG_FILE" + # Create temp file with changelog entry + TMP_FILE=$(mktemp) + { + echo "" + echo "$VERSION_HEADER" + echo "" + echo "$COMMITS" + } > "$TMP_FILE" + + # Insert after Unreleased header + sed -i "/^## \[Unreleased\]/r $TMP_FILE" "$CHANGELOG_FILE" + rm "$TMP_FILE" echo "Updated CHANGELOG.md" echo "Changelog entries:" echo "$COMMITS" + - name: Update version in issue templates + run: | + NEW_VERSION="${{ steps.version.outputs.new_version }}" + + # Calculate version to remove (keep 5 versions) + PREVIOUS_VERSION="${{ steps.version.outputs.previous_version }}" + + # Bug report template - insert new version after development (unreleased) + BUG_TEMPLATE=".github/ISSUE_TEMPLATE/bug report.yml" + sed -i "/- development (unreleased)/a\\ - OpenSourcePOS ${NEW_VERSION}" "$BUG_TEMPLATE" + # Remove the oldest version (5th version from the end) + sed -i "/OpenSourcePOS 3\\.3\\.7/d" "$BUG_TEMPLATE" + echo "Updated $BUG_TEMPLATE" + + # Feature request template - insert new version after development (unreleased) + FEATURE_TEMPLATE=".github/ISSUE_TEMPLATE/feature_request.yml" + sed -i "/- development (unreleased)/a\\ - OpenSourcePOS ${NEW_VERSION}" "$FEATURE_TEMPLATE" + # Remove the oldest version (5th version from the end) + sed -i "/OpenSourcePOS 3\\.3\\.7/d" "$FEATURE_TEMPLATE" + echo "Updated $FEATURE_TEMPLATE" + - name: Commit version bump run: | git config user.name "github-actions[bot]" @@ -136,6 +167,6 @@ jobs: NEW_VERSION="${{ steps.version.outputs.new_version }}" - git add app/Config/App.php package.json docker-compose.nginx.yml CHANGELOG.md README.md + git add app/Config/App.php package.json docker-compose.nginx.yml CHANGELOG.md README.md .github/ISSUE_TEMPLATE/ git commit -m "chore: release version $NEW_VERSION" git push origin HEAD \ No newline at end of file