From 744d2d43110ba7a0b62595d909fb65d5d27a9af5 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Mon, 26 May 2025 15:45:48 +0200 Subject: [PATCH] actions fix or 2070 (#3432) * chore(build): Better error handling Signed-off-by: rjshrjndrn * fix(build): remove fetch depth, as it might cause issue in rebase Signed-off-by: rjshrjndrn * fix(build): proper platform Signed-off-by: rjshrjndrn --------- Signed-off-by: rjshrjndrn --- .github/workflows/patch-build.yaml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/patch-build.yaml b/.github/workflows/patch-build.yaml index 3588883dd..4630e1297 100644 --- a/.github/workflows/patch-build.yaml +++ b/.github/workflows/patch-build.yaml @@ -19,11 +19,19 @@ jobs: DEPOT_PROJECT_ID: ${{ secrets.DEPOT_PROJECT_ID }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Rebase with main branch, to make sure the code has latest main changes run: | - git fetch origin main - git rebase origin/main + git remote -v + git config --global user.email "action@github.com" + git config --global user.name "GitHub Action" + git config --global rebase.autoStash true + git fetch origin main:main + git rebase main + git log -3 - name: Downloading yq run: | @@ -46,6 +54,8 @@ jobs: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${{ secrets.RELEASE_OSS_REGISTRY }} - uses: depot/setup-action@v1 + env: + DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }} - name: Get HEAD Commit ID run: echo "HEAD_COMMIT_ID=$(git rev-parse HEAD)" >> $GITHUB_ENV - name: Define Branch Name @@ -79,7 +89,7 @@ jobs: } function clone_msaas() { [ -d $MSAAS_REPO_FOLDER ] || { - git clone -b dev --recursive https://x-access-token:$MSAAS_REPO_CLONE_TOKEN@$MSAAS_REPO_URL $MSAAS_REPO_FOLDER + git clone -b dev --recursive $MSAAS_REPO_URL $MSAAS_REPO_FOLDER cd $MSAAS_REPO_FOLDER cd openreplay && git fetch origin && git checkout main # This have to be changed to specific tag git log -1 @@ -98,7 +108,7 @@ jobs: else cd $MSAAS_REPO_FOLDER/openreplay/$service fi - IMAGE_TAG=$version DOCKER_RUNTIME="depot" DOCKER_BUILD_ARGS="--push" ARCH=arm64 DOCKER_REPO=$DOCKER_REPO_ARM PUSH_IMAGE=0 bash build.sh >> /tmp/arm.txt + IMAGE_TAG=$version DOCKER_RUNTIME="depot" DOCKER_BUILD_ARGS="--push" ARCH=amd64 DOCKER_REPO=$DOCKER_REPO_OSS PUSH_IMAGE=0 bash $BUILD_SCRIPT_NAME >> /tmp/managed_${service}.txt 2>&1 || { echo "Build failed for $service"; cat /tmp/managed_${service}.txt; exit 1; } } # Checking for backend images ls backend/cmd >> /tmp/backend.txt