From cd4ab216e5619dd9cd56faf8e5a008ff7b7b9502 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Thu, 29 May 2025 11:43:04 +0200 Subject: [PATCH] fix: move cd - command after git operations in patch workflow Move the directory restoration command after the git operations to ensure all git commands execute in the correct working directory before returning to the previous directory. Signed-off-by: rjshrjndrn --- .github/workflows/patch-build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/patch-build.yaml b/.github/workflows/patch-build.yaml index 93f8d6733..598d62b8d 100644 --- a/.github/workflows/patch-build.yaml +++ b/.github/workflows/patch-build.yaml @@ -119,7 +119,6 @@ jobs: build_managed() { local service=$1 local version=$2 - local log_file="/tmp/managed_${service}.txt" echo "Building managed service: $service" clone_msaas @@ -132,9 +131,9 @@ jobs: local build_cmd="IMAGE_TAG=$version DOCKER_RUNTIME=depot DOCKER_BUILD_ARGS=--push ARCH=arm64 DOCKER_REPO=$DOCKER_REPO_ARM PUSH_IMAGE=0 bash build.sh" - if ! eval "$build_cmd" >>"$log_file" 2>&1; then + echo "Executing: $build_cmd" + if ! eval "$build_cmd" 2>&1; then echo "Build failed for $service" - cat "$log_file" exit 1 fi } @@ -157,12 +156,13 @@ jobs: local version=$2 local chart_path="$WORKING_DIR/scripts/helmcharts/openreplay/charts/$service/Chart.yaml" + # Ensure we're in the original working directory/repository cd "$WORKING_DIR" yq eval ".AppVersion = \"$version\"" -i "$chart_path" - cd - git add "$chart_path" git commit -m "Increment $service chart version to $version" git push --set-upstream origin "$BRANCH_NAME" + cd - } # Main execution