From eab6e519482f886c5e4a476ba20c1e0860adb563 Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Fri, 20 Jun 2025 19:13:56 +0300 Subject: [PATCH] Add secret to git --- .woodpecker.yml | 3 +++ automation/cloudflared-sync.sh | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 9705fa2..f474155 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,3 +5,6 @@ steps: commands: - apk add --no-cache git bash curl yq - bash automation/cloudflared-sync.sh + environment: + GIT_TOKEN: + from_secret: GIT_TOKEN \ No newline at end of file diff --git a/automation/cloudflared-sync.sh b/automation/cloudflared-sync.sh index 41c81ce..6f0d73e 100644 --- a/automation/cloudflared-sync.sh +++ b/automation/cloudflared-sync.sh @@ -12,7 +12,7 @@ mkdir -p .tmp-repos # === REPO CONFIG === SANDBOX_REPO_URL="https://git.dvirlabs.com/dvirlabs/sandbox.git" -INFRA_REPO_URL="https://git.dvirlabs.com/dvirlabs/infra.git" +INFRA_REPO_URL="https://${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/infra.git" SANDBOX_CLONE=".tmp-repos/sandbox" INFRA_CLONE=".tmp-repos/infra" GENERATED_FILE="generated-values/cloudflared-values.yaml" @@ -93,6 +93,7 @@ echo "📤 Pushing updated values.yaml to infra repo..." cd "$INFRA_CLONE" git config user.name "woodpecker-bot" git config user.email "ci@dvirlabs.com" +git remote set-url origin "https://${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/infra.git" # Only commit if there are changes if ! git diff --quiet manifests/cloudflared/values.yaml; then