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
This commit is contained in:
pironantoine
2026-04-04 14:03:32 +00:00
parent f10de55132
commit 0528d60719
+28
View File
@@ -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."