Skip to content

Commit 51be6e4

Browse files
authored
Resolve issues with readme file being committed (#7)
* use braces for the git add to support a glob-based readme filename * bail if nothing was changed
1 parent 3d889ce commit 51be6e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/validate-plugin-version.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,19 @@ main() {
7676
git config user.name "github-actions"
7777
git config user.email "[email protected]"
7878
git checkout -b "$BRANCH_NAME"
79-
git add "${PLUGIN_PATH}/readme.txt" "${PLUGIN_PATH}/README.md" || true
79+
git add "${PLUGIN_PATH}/"{readme,README}.* || true
8080

8181
# Bail before committing anything if we're dry-running.
8282
if [[ "${DRY_RUN}" == "true" ]]; then
8383
echo "Dry run enabled. Happy testing."
8484
exit 0
8585
fi
8686

87+
if [[ -z $(git status --porcelain) ]]; then
88+
echo "No changes to commit. Exiting."
89+
exit 1
90+
fi
91+
8792
echo "Committing changes and pushing to the repository."
8893
git commit -m "Update Tested Up To version to $CURRENT_WP_VERSION"
8994
git push origin "$BRANCH_NAME"

0 commit comments

Comments
 (0)