From 0528d6071941f683eb1679f139c754fc77c2e1c2 Mon Sep 17 00:00:00 2001 From: pironantoine <57062554-pironantoine@users.noreply.replit.com> Date: Sat, 4 Apr 2026 14:03:32 +0000 Subject: [PATCH] Add a script to push code securely to the remote repository Create a new shell script to handle pushing code to Gitea using environment variables for authentication, bypassing potential credential issues in newer Git versions. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 923ae0e3-a363-4db8-b04a-e8baca2a1330 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 3e699aa7-3a4c-4150-832f-2e0225e7f67d Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8af7d2ec-2cc3-4ece-8af3-9f071488d072/923ae0e3-a363-4db8-b04a-e8baca2a1330/vOeFCU4 Replit-Helium-Checkpoint-Created: true --- scripts/push-gitea.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/push-gitea.sh diff --git a/scripts/push-gitea.sh b/scripts/push-gitea.sh new file mode 100644 index 0000000..4f0a1e9 --- /dev/null +++ b/scripts/push-gitea.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# push-gitea.sh — Pousse la branche main vers Gitea +# Usage : bash scripts/push-gitea.sh +# +# Prérequis : variable d'environnement GITEA_TOKEN définie +# (via Replit Secrets ou export GITEA_TOKEN=votre_token) + +set -e + +if [ -z "$GITEA_TOKEN" ]; then + echo "Erreur : la variable GITEA_TOKEN n'est pas définie." + echo "Définissez-la dans Replit > Secrets > Ajouter un secret : GITEA_TOKEN" + exit 1 +fi + +GITEA_USER="billisdead" +GITEA_HOST="homegit.gyozamancave.fr" +REPO="la-voix-du-peuple" + +B64=$(printf '%s' "${GITEA_USER}:${GITEA_TOKEN}" | base64 -w0) + +echo "Envoi de la branche main vers https://${GITEA_HOST}/${GITEA_USER}/${REPO}.git ..." + +GIT_TERMINAL_PROMPT=0 git \ + -c "http.extraHeader=Authorization: Basic ${B64}" \ + push origin main + +echo "Synchronisation terminée."