From 79ac24217a8831040cb45b1dac1adc86ec7f410f Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Tue, 16 Jun 2026 03:28:59 +0530 Subject: [PATCH] fix(ci): isolate gitops checkout dir --- .github/workflows/build-and-deploy-ghcr.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy-ghcr.yml b/.github/workflows/build-and-deploy-ghcr.yml index 901e436..dc57dcf 100644 --- a/.github/workflows/build-and-deploy-ghcr.yml +++ b/.github/workflows/build-and-deploy-ghcr.yml @@ -54,8 +54,10 @@ jobs: run: | set -euo pipefail image_ref="${IMAGE_NAME}@${{ steps.build.outputs.digest }}" - git clone "https://${{ secrets.GHCR_USERNAME }}:${GITOPS_TOKEN}@github.com/${GITOPS_REPO}.git" /tmp/nxtgauge-gitops - cd /tmp/nxtgauge-gitops + workdir="$(mktemp -d /tmp/nxtgauge-gitops.XXXXXX)" + trap 'rm -rf "$workdir"' EXIT + git clone "https://${{ secrets.GHCR_USERNAME }}:${GITOPS_TOKEN}@github.com/${GITOPS_REPO}.git" "$workdir" + cd "$workdir" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" for attempt in 1 2 3 4 5; do