From 513522b251ae2ed116253eb60372e415f5e6d599 Mon Sep 17 00:00:00 2001 From: Adam Cassis Date: Thu, 2 Apr 2026 12:58:35 +0200 Subject: [PATCH 1/2] fix(release-wporg): only deploy stable version tags to WordPress.org The previous command (git rev-list --tags --max-count=1) selected the tag pointing to the most recent commit by timestamp across all branches. When an alpha or hotfix tag pointed to a newer commit than the stable release tag, the pre-release version was deployed to WordPress.org. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/github/release-wporg.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/github/release-wporg.sh b/scripts/github/release-wporg.sh index 58acf66..a5f12ee 100755 --- a/scripts/github/release-wporg.sh +++ b/scripts/github/release-wporg.sh @@ -11,7 +11,11 @@ SVN_PLUGINS_URL="https://plugins.svn.wordpress.org" SVN_REPO_LOCAL_PATH="release/svn" SVN_REPO_URL="$SVN_PLUGINS_URL/$WP_ORG_PLUGIN_NAME" -LATEST_GIT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) +LATEST_GIT_TAG=$(git tag --list 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1) +if [ -z "$LATEST_GIT_TAG" ]; then + echo "No stable version tag found. Aborting deployment." + exit 1 +fi # Remove the "v" at the beginning of the git tag LATEST_SVN_TAG=${LATEST_GIT_TAG:1} From 56fccb68122c463c5084ab31526f01b81e7b8dac Mon Sep 17 00:00:00 2001 From: Adam Cassis Date: Thu, 2 Apr 2026 13:05:30 +0200 Subject: [PATCH 2/2] fix(release-wporg): use POSIX-compatible head -n 1 Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/github/release-wporg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/github/release-wporg.sh b/scripts/github/release-wporg.sh index a5f12ee..ab3e285 100755 --- a/scripts/github/release-wporg.sh +++ b/scripts/github/release-wporg.sh @@ -11,7 +11,7 @@ SVN_PLUGINS_URL="https://plugins.svn.wordpress.org" SVN_REPO_LOCAL_PATH="release/svn" SVN_REPO_URL="$SVN_PLUGINS_URL/$WP_ORG_PLUGIN_NAME" -LATEST_GIT_TAG=$(git tag --list 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1) +LATEST_GIT_TAG=$(git tag --list 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) if [ -z "$LATEST_GIT_TAG" ]; then echo "No stable version tag found. Aborting deployment." exit 1