Add secret to git

This commit is contained in:
dvirlabs 2025-06-20 19:13:56 +03:00
parent 6009dfdb9a
commit eab6e51948
2 changed files with 5 additions and 1 deletions

View File

@ -5,3 +5,6 @@ steps:
commands: commands:
- apk add --no-cache git bash curl yq - apk add --no-cache git bash curl yq
- bash automation/cloudflared-sync.sh - bash automation/cloudflared-sync.sh
environment:
GIT_TOKEN:
from_secret: GIT_TOKEN

View File

@ -12,7 +12,7 @@ mkdir -p .tmp-repos
# === REPO CONFIG === # === REPO CONFIG ===
SANDBOX_REPO_URL="https://git.dvirlabs.com/dvirlabs/sandbox.git" 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" SANDBOX_CLONE=".tmp-repos/sandbox"
INFRA_CLONE=".tmp-repos/infra" INFRA_CLONE=".tmp-repos/infra"
GENERATED_FILE="generated-values/cloudflared-values.yaml" GENERATED_FILE="generated-values/cloudflared-values.yaml"
@ -93,6 +93,7 @@ echo "📤 Pushing updated values.yaml to infra repo..."
cd "$INFRA_CLONE" cd "$INFRA_CLONE"
git config user.name "woodpecker-bot" git config user.name "woodpecker-bot"
git config user.email "ci@dvirlabs.com" 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 # Only commit if there are changes
if ! git diff --quiet manifests/cloudflared/values.yaml; then if ! git diff --quiet manifests/cloudflared/values.yaml; then