Skip to content

Commit dd4ef07

Browse files
adekbadekclaude
andauthored
fix(release-wporg): only deploy stable version tags to WordPress.org (#231)
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) <noreply@anthropic.com>
1 parent c84c835 commit dd4ef07

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/github/release-wporg.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ SVN_PLUGINS_URL="https://plugins.svn.wordpress.org"
1111
SVN_REPO_LOCAL_PATH="release/svn"
1212
SVN_REPO_URL="$SVN_PLUGINS_URL/$WP_ORG_PLUGIN_NAME"
1313

14-
LATEST_GIT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
14+
LATEST_GIT_TAG=$(git tag --list 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)
15+
if [ -z "$LATEST_GIT_TAG" ]; then
16+
echo "No stable version tag found. Aborting deployment."
17+
exit 1
18+
fi
1519
# Remove the "v" at the beginning of the git tag
1620
LATEST_SVN_TAG=${LATEST_GIT_TAG:1}
1721

0 commit comments

Comments
 (0)