Skip to content

Commit a682ff9

Browse files
committed
Refactoring: get rid of a duplicated check
1 parent bef6d04 commit a682ff9

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

.github/workflows/wordpress-org-release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ jobs:
133133
echo "README_VERSION=$README_VERSION" >> "$GITHUB_OUTPUT"
134134
135135
MISMATCH=0
136+
CHECKED_AGAINST="$PLUGIN_FILE"
136137
137138
if [ "$VALIDATED_PLUGIN_VERSION" != "$PLUGIN_FILE_VERSION" ]; then
138139
echo "❌ Input version ($VALIDATED_PLUGIN_VERSION) does not match $PLUGIN_FILE ($PLUGIN_FILE_VERSION)"
@@ -143,6 +144,7 @@ jobs:
143144
# published version, not PLUGIN_VERSION - it's checked against SVN's existing tags
144145
# instead, once the SVN repository is checked out.
145146
if [ "$UPDATE_TRUNK_ONLY" != "true" ]; then
147+
CHECKED_AGAINST="$PLUGIN_FILE and readme.txt"
146148
if [ "$VALIDATED_PLUGIN_VERSION" != "$README_VERSION" ]; then
147149
echo "❌ Input version ($VALIDATED_PLUGIN_VERSION) does not match readme.txt Stable tag ($README_VERSION)"
148150
MISMATCH=1
@@ -151,11 +153,7 @@ jobs:
151153
152154
[ "$MISMATCH" = "1" ] && exit 1
153155
154-
if [ "$UPDATE_TRUNK_ONLY" != "true" ]; then
155-
echo "✅ Version $VALIDATED_PLUGIN_VERSION is consistent with $PLUGIN_FILE and readme.txt"
156-
else
157-
echo "✅ Version $VALIDATED_PLUGIN_VERSION is consistent with $PLUGIN_FILE"
158-
fi
156+
echo "✅ Version $VALIDATED_PLUGIN_VERSION is consistent with $CHECKED_AGAINST"
159157
160158
- name: Checkout SVN repository
161159
env:

0 commit comments

Comments
 (0)