diff --git a/.github/workflows/db-push-migration.yaml b/.github/workflows/db-push-migration.yaml index 185679d..e6d91d8 100644 --- a/.github/workflows/db-push-migration.yaml +++ b/.github/workflows/db-push-migration.yaml @@ -103,6 +103,19 @@ jobs: - name: push migration file to remote db run: pnpm supabase db push + - name: commit migration file + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + if git diff --name-only | grep -q "supabase/migrations/.*.sql"; then \ + git add ./; \ + git commit -m "actions: 🤖 (supabase) updated migration file"; \ + git push origin HEAD:${GITHUB_REF} --force; \ + echo "Committed changes to migration history"; \ + else \ + echo "No changes detected in migration history"; \ + fi + db-push-migration-check: runs-on: ubuntu-latest needs: push