You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[minor] Preserve whitespace and add branch as an input (#9)
* preserve whitespace
this is important for md files where whitespaces represent line breaks
* add branch as an input
* move branch down to when we create the new one
it might not be the right thing...
* use github ref for dry run
* roll back changes and just make the pr work from the passed base branch
* lint
Copy file name to clipboardExpand all lines: bin/validate-plugin-version.sh
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ main() {
47
47
48
48
# Compare versions using PHP
49
49
if php -r "exit(version_compare('$TESTED_UP_TO', '$CURRENT_WP_VERSION', '>=') ? 0 : 1);";then
50
-
echo"Tested up to version matches or is greater than the current WordPress version. Nothing to do here."
50
+
echo"Tested up to version matches or is greater than the current WordPress version. Check passed."
51
51
exit
52
52
fi
53
53
echo"Tested up to version ($TESTED_UP_TO) is less than current WordPress version ($CURRENT_WP_VERSION)."
@@ -61,9 +61,9 @@ main() {
61
61
if [[ -f"$full_path" ]];then
62
62
echo"Updating 'Tested up to' version in $full_path"
63
63
if [[ "$OSTYPE"=="darwin"* ]];then
64
-
sed -i '' -E "s/(Tested up to: ).*/\1$CURRENT_WP_VERSION/""$full_path"
64
+
sed -i '' -E "s/(Tested up to: )([0-9.]+)([[:space:]]*)/\1$CURRENT_WP_VERSION\3/""$full_path"
65
65
else
66
-
sed -i -E "s/(Tested up to: ).*/\1$CURRENT_WP_VERSION/""$full_path"
66
+
sed -i -E "s/(Tested up to: )([0-9.]+)([[:space:]]*)/\1$CURRENT_WP_VERSION\3/""$full_path"
67
67
fi
68
68
fi
69
69
done
@@ -108,7 +108,7 @@ main() {
108
108
git commit -m "Update Tested Up To version to $CURRENT_WP_VERSION"
109
109
git push origin "$BRANCH_NAME"
110
110
111
-
gh pr create --title "Update Tested Up To version to $CURRENT_WP_VERSION" --body "This pull request updates the \"Tested up to\" version in specified files (${FILENAMES}) to match the current WordPress version $CURRENT_WP_VERSION."
111
+
gh pr create --title "Update Tested Up To version to $CURRENT_WP_VERSION" --body "This pull request updates the \"Tested up to\" version in specified files (${FILENAMES}) to match the current WordPress version $CURRENT_WP_VERSION." --base "$BRANCH"
0 commit comments