feat: add workflow git
Sécurité - Architecture Git-Flow / validate-flow (pull_request) Failing after 0s
🔍 Contrôle Qualité & Sécurité (QA) / 🛡️ Quality Gate & Security Check (pull_request) Failing after 4s

This commit is contained in:
LathanDevers
2026-08-03 14:03:56 +02:00
parent def5c304e3
commit 74588fbd5d
4 changed files with 177 additions and 61 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Sécurité - Architecture Git-Flow
on:
pull_request:
branches:
- test
- acc
- master
jobs:
validate-flow:
runs-on: ubuntu-latest
steps:
- name: Vérification du flux de promotion
run: |
TARGET_BRANCH="${{ github.base_ref }}"
SOURCE_BRANCH="${{ github.head_ref }}"
echo "Tentative de promotion : $SOURCE_BRANCH ➔ $TARGET_BRANCH"
# Règle 1 : Vers TEST (Doit venir de DEV)
if [ "$TARGET_BRANCH" == "test" ] && [ "$SOURCE_BRANCH" != "dev" ]; then
echo "ERREUR : L'environnement TEST ne peut recevoir que du code de DEV."
exit 1
fi
# Règle 2 : Vers ACC (Doit venir de TEST)
if [ "$TARGET_BRANCH" == "acc" ] && [ "$SOURCE_BRANCH" != "test" ]; then
echo "ERREUR : L'environnement d'ACCEPTATION ne peut recevoir que du code de TEST."
exit 1
fi
# Règle 3 : Vers PROD (Doit venir de ACC)
if [ "$TARGET_BRANCH" == "master" ] && [ "$SOURCE_BRANCH" != "acc" ]; then
echo "ERREUR : La PRODUCTION ne peut recevoir que du code validé en ACCEPTATION (acc)."
exit 1
fi
echo "Flux réglementaire respecté ! Promotion autorisée."