diff --git a/.github/workflows/prerelease-changelog-update.yml b/.github/workflows/prerelease-changelog-update.yml index ecc9a0b..e2c89c0 100644 --- a/.github/workflows/prerelease-changelog-update.yml +++ b/.github/workflows/prerelease-changelog-update.yml @@ -58,23 +58,29 @@ jobs: # A 'package.json' can be in place for Plugins or modules, that uses any build or test runs. if [ -f package.json ]; then - echo "Maybe UPDATE version in package.json: $NEW_VERSION" sed -ri "s/(\"version\":[[:space:]]*\")[0-9]+\.[0-9]+\.[0-9]+(\")/\1$NEW_VERSION\2/g" package.json - echo "deploy=BUILD" >> "$GITHUB_OUTPUT" + + if ! git diff --quiet --exit-code package.json; then + echo "Update version in package.json: $NEW_VERSION" + echo "deploy=BUILD" >> "$GITHUB_OUTPUT" + fi fi # A `plugin.php' is the most common and can be found in almost(!) every repository. if [ -f plugin.php ]; then - echo "Maybe UPDATE version in plugin.php: $NEW_VERSION" + echo "UPDATE version in plugin.php: $NEW_VERSION" # made with https://seddy.dev/ sed -ri "s/(Version:[[:space:]]*)[0-9]+\.[0-9]+\.[0-9]+/\1$NEW_VERSION/g" plugin.php fi # A 'readme.md' needs to be in place for regular Plugins hosted on wp.org/plugins. if [ -f readme.md ]; then - echo "Maybe UPDATE version in readme.md: $NEW_VERSION" - echo "deploy=WPORG" >> "$GITHUB_OUTPUT" sed -ri "s/(Stable tag:[[:space:]]*)[0-9]+\.[0-9]+\.[0-9]+/\1$NEW_VERSION/g" readme.md + + if ! git diff --quiet --exit-code readme.md; then + echo "Update version in readme.md: $NEW_VERSION" + echo "deploy=WPORG" >> "$GITHUB_OUTPUT" + fi fi @@ -91,7 +97,7 @@ jobs: # branch: ${{ github.event.release.target_commitish }} branch: main #unprotect_reviews: true # has anoying side-effect: settings stays disabled if workflow fails - acceptable_conclusions: success,skipped # A comma-separated list of acceptable statuses. If any of these statuses are present, the action will not fail. + acceptable_conclusions: success # A comma-separated list of acceptable statuses. If any of these statuses are present, the action will not fail. #-----------------------------------------------------------------------------------------------------------------------