From a38a2fd1850dbf720c4a192a5c5085a6807bde18 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Tue, 16 Jun 2026 03:29:01 +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 1f89f73..59926c5 100644 --- a/.github/workflows/build-and-deploy-ghcr.yml +++ b/.github/workflows/build-and-deploy-ghcr.yml @@ -76,8 +76,10 @@ jobs: GITOPS_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }} run: | set -euo pipefail - 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