From 92badd28df912b19200c93afd77387925cad60af Mon Sep 17 00:00:00 2001 From: Navjot Tomer Date: Tue, 23 Apr 2024 16:16:32 +0530 Subject: [PATCH] Fix workflow to handle already update constant. [release-5.2.0] --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33ac3f512..e3c212b7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,16 +63,17 @@ jobs: git merge develop else git checkout -b release/$BASE_VERSION - git pull origin develop fi fi # Update version in codebase sed -i -E "s/define\('OSCLASS_VERSION.+\);/define('OSCLASS_VERSION', '$VERSION');/" oc-includes/osclass/default-constants.php - # Commit changes - git add oc-includes/osclass/default-constants.php - git commit -m "Update version to $VERSION" + # Commit changes if changes were made + if [[ $(git status --porcelain) ]]; then + git add oc-includes/osclass/default-constants.php + git commit -m "Update version to $VERSION" + fi # Push changes and create tag git push origin HEAD