chore : version 1.5.0, push.sh bloque main, CHANGELOG
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+12
-3
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Pousse le code Folio vers git.abonnel.fr/cedricAbonnel/folio
|
||||
# Pousse la branche courante vers git.abonnel.fr/cedricAbonnel/folio
|
||||
# Ne pousse JAMAIS directement sur main — passer par une PR.
|
||||
# Usage : ./scripts/push.sh "message de commit"
|
||||
set -euo pipefail
|
||||
|
||||
@@ -20,6 +21,13 @@ if [ ! -d .git ]; then
|
||||
echo "→ Dépôt git initialisé"
|
||||
fi
|
||||
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [[ "$BRANCH" == "main" ]]; then
|
||||
echo "✗ Refus de pousser directement sur main."
|
||||
echo " Créer une branche feature : git checkout -b feat/nom"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extraire la version depuis CHANGELOG.md (première entrée ## [X.Y.Z])
|
||||
FOLIO_VERSION=$(grep -m1 '^\#\# \[[0-9]' CHANGELOG.md | sed 's/.*\[\([^]]*\)\].*/\1/')
|
||||
if [[ -z "$FOLIO_VERSION" ]]; then
|
||||
@@ -32,5 +40,6 @@ echo "→ Version : $FOLIO_VERSION"
|
||||
git add -A
|
||||
git diff --cached --quiet && echo "(rien à committer)" && exit 0
|
||||
git commit -m "$MSG"
|
||||
git push origin main
|
||||
echo "✓ Poussé vers folio"
|
||||
git push origin "$BRANCH"
|
||||
echo "✓ Poussé vers folio (branche $BRANCH)"
|
||||
echo " → Ouvrir une PR sur https://git.abonnel.fr/cedricAbonnel/folio/pulls/new/$BRANCH"
|
||||
|
||||
Reference in New Issue
Block a user