diff --git a/.github/build/build-deb-package.bash b/.github/build/build-deb-package.bash index a870a71ea..3955457a8 100755 --- a/.github/build/build-deb-package.bash +++ b/.github/build/build-deb-package.bash @@ -71,8 +71,10 @@ build_prod() { # Print package version echo -n " package version: " - # Get latest product version (theme vs product); expects to start in theme - # repo and switch to product repo internally + # Switch to product directory explicitly + cd "$root_prod" || exit 1 + + # Get latest product version (theme vs product) date_version=$(get_latest_commit_date_version "$root_prod") # Handle other params diff --git a/.github/build/build-rpm-package.bash b/.github/build/build-rpm-package.bash index d03569d5b..6a43db991 100755 --- a/.github/build/build-rpm-package.bash +++ b/.github/build/build-rpm-package.bash @@ -70,8 +70,10 @@ build_prod() { # Print package version echo -n " package version: " - # Get latest product version (theme vs product); expects to start in theme - # repo and switch to product repo internally + # Switch to product directory explicitly + cd "$root_prod" || exit 1 + + # Get latest product version (theme vs product) date_version=$(get_latest_commit_date_version "$root_prod") # Handle other params diff --git a/.github/build/functions.bash b/.github/build/functions.bash index 131290509..5df46b31f 100755 --- a/.github/build/functions.bash +++ b/.github/build/functions.bash @@ -201,13 +201,16 @@ get_latest_commit_date_version() { local max_prod local highest_version local root_prod="$1" - - theme_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M') - cd "$root_prod" || exit 1 - prod_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M') - max_prod=("$theme_version" "$prod_version") - highest_version=$(max "${max_prod[@]}") - echo "$highest_version" + local root_theme="$root_prod/authentic-theme" + ( + cd "$root_theme" || exit 1 + theme_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M') + cd "$root_prod" || exit 1 + prod_version=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d%H%M') + max_prod=("$theme_version" "$prod_version") + highest_version=$(max "${max_prod[@]}") + echo "$highest_version" + ) } # Pull project repo and theme