From 5ca47c19bea0503b67f3a6ffa87d246010db144d Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Wed, 18 Mar 2026 21:40:13 +0000 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20.gitea/workflows/update-seed.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/update-seed.yaml | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .gitea/workflows/update-seed.yaml diff --git a/.gitea/workflows/update-seed.yaml b/.gitea/workflows/update-seed.yaml new file mode 100644 index 0000000..dfb5b1f --- /dev/null +++ b/.gitea/workflows/update-seed.yaml @@ -0,0 +1,55 @@ +name: Update database types + +on: + push: + branches: + - main + paths: + - supabase/migrations/*.sql + workflow_dispatch: + +jobs: + update: + runs-on: ubuntu-latest + + env: + SUPABASE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + PROJECT_REF: ${{ secrets.SUPABASE_PROJECT_ID }} + DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }} + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: supabase/setup-cli@v1 + with: + version: latest + + - name: Generate database types + run: | + supabase db dump -f supabase/seed.sql --data-only + + - name: Check for changes + id: git_status + run: | + if [[ -n "$(git status --porcelain)" ]]; then + echo "changed=true" >> $GITEA_OUTPUT + else + echo "changed=false" >> $GITEA_OUTPUT + fi + + - name: Commit changes + if: steps.git_status.outputs.changed == 'true' + run: | + git config user.name "supabot" + git config user.email "supabot@example.com" + git add supabase/seed.sql + git commit -m "chore: update database seed" + + - name: Push changes + if: steps.git_status.outputs.changed == 'true' + run: | + git pull + git push \ No newline at end of file