Actualizar .gitea/workflows/update-types.yml
This commit is contained in:
@@ -1,41 +1,18 @@
|
|||||||
name: Update database types
|
name: Update database types
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
push:
|
||||||
- cron: "0 0 * * *"
|
branches: [ main ]
|
||||||
|
paths:
|
||||||
|
- '*.sql'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.head_ref != 'supabot**'
|
||||||
env:
|
|
||||||
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
|
|
||||||
PROJECT_REF: ${{ secrets.SUPABASE_PROJECT_ID }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: lyqht/generate-supabase-db-types-github-action@main
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
SUPABASE_REF_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
|
||||||
|
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
|
||||||
- uses: actions/setup-node@v4
|
DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
|
||||||
with:
|
OUTPUT_PATH: db.types.ts
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- run: npm run update-types
|
|
||||||
|
|
||||||
- name: Check for changes
|
|
||||||
id: git_status
|
|
||||||
run: |
|
|
||||||
echo "status=$(git status -s)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Commit changes
|
|
||||||
if: ${{ contains(steps.git_status.outputs.status, ' ') }}
|
|
||||||
run: |
|
|
||||||
git add supabase/functions/_shared/database.types.ts
|
|
||||||
git config user.email "ci@gitea.local"
|
|
||||||
git config user.name "gitea-actions"
|
|
||||||
git commit -m "Update database types"
|
|
||||||
|
|
||||||
- name: Push changes
|
|
||||||
if: ${{ contains(steps.git_status.outputs.status, ' ') }}
|
|
||||||
run: git push
|
|
||||||
Reference in New Issue
Block a user