Skip to content

Commit 1aaa8c2

Browse files
committed
Feature: Different WP_VERSION for each branch
Signed-off-by: dhsathiya <[email protected]>
1 parent 3733951 commit 1aaa8c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

main.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,15 @@ function setup_wordpress_files() {
166166
cd "$HTDOCS"
167167
export build_root="$(pwd)"
168168

169-
WP_VERSION=${WP_VERSION:-"latest"}
169+
hosts_wp_version=$(cat $hosts_file | shyaml get-value "$GITHUB_BRANCH.WP_VERSION" 2> /dev/null)
170+
171+
# Check if WP_VERSION is already defined in hosts.yml
172+
# Priority: 1. hosts.yml, 2. workflow file, else use latest
173+
if [[ -n $hosts_wp_version ]]; then
174+
WP_VERSION="$hosts_wp_version"
175+
elif [[ -z $WP_VERSION ]]; then
176+
WP_VERSION="latest"
177+
fi
170178

171179
if [[ "$WP_MINOR_UPDATE" == "true" ]] && [[ "$WP_VERSION" != "latest" ]]; then
172180
LATEST_MINOR_VERSION=$(\

0 commit comments

Comments
 (0)