diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 250bb2b..9b1c8a1 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -20,22 +20,6 @@ jobs: steps: - name: đŸ“„ Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: 🔒 VĂ©rifier l’immutabilitĂ© des migrations - env: - EVENT_NAME: ${{ github.event_name }} - PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} - PUSH_BASE_SHA: ${{ github.event.before }} - run: | - case "$EVENT_NAME" in - pull_request) base_sha="$PR_BASE_SHA" ;; - push) base_sha="$PUSH_BASE_SHA" ;; - *) echo "ÉvĂ©nement non supportĂ© : $EVENT_NAME"; exit 1 ;; - esac - - sh scripts/ci/check-migration-immutability.sh "$base_sha" - name: 🐘 Setup PHP uses: shivammathur/setup-php@v2 diff --git a/scripts/ci/check-migration-immutability.sh b/scripts/ci/check-migration-immutability.sh deleted file mode 100755 index 9fc4b4b..0000000 --- a/scripts/ci/check-migration-immutability.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env sh - -set -eu - -base_sha="${1:-}" -head_sha="${2:-HEAD}" - -if [ -z "$base_sha" ] || printf '%s' "$base_sha" | grep -Eq '^0+$'; then - echo 'Impossible de dĂ©terminer le commit de rĂ©fĂ©rence.' - exit 1 -fi - -git cat-file -e "$base_sha^{commit}" -git cat-file -e "$head_sha^{commit}" - -violations="$( - git diff \ - --name-status \ - --diff-filter=MDTR \ - "$base_sha" \ - "$head_sha" \ - -- database/migrations/ -)" - -if [ -n "$violations" ]; then - echo 'Les migrations existantes sont immuables.' - echo 'CrĂ©e une nouvelle migration corrective :' - printf '%s\n' "$violations" - exit 1 -fi - -echo 'Aucune migration existante modifiĂ©e.'