Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

Commit fdc2a95

Browse files
committed
add readme
1 parent 16ae10a commit fdc2a95

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# GitHub action to generate Supabase Database types
2+
3+
This GitHub action workflow aims to help you to create Supabase database definition types based on the Swagger OpenAPI specification of your Supabase REST data endpoint.
4+
5+
## What it does
6+
7+
This workflow is a composite action:
8+
9+
- To generate database types based on the Swagger OpenAPI specification of your Supabase project REST data endpoint, [openapi-typescript](https://github.com/drwpow/openapi-typescript) is used.
10+
- Checking for file changes is done using the [get-diff-action](https://github.com/technote-space/get-diff-action).
11+
- Commit and push github actions to your repo are performed by the [git-auto-commit action](https://github.com/stefanzweifel/git-auto-commit-action).
12+
13+
## How to use
14+
15+
If you are new to GitHub Actions, refer to [this section](#if-you-dont-have-an-existing-github-action-workflow-for-your-repository). Otherwise, you can get started by referring to to the example given and the input options available.
16+
17+
### Example
18+
19+
```yml
20+
name: Update database types
21+
on:
22+
schedule:
23+
- cron: '*/60 * * * *'
24+
workflow_dispatch:
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: lyqht/generate-supabase-database-types@main
32+
with:
33+
SUPABASE_URL: ${{secrets.SUPABASE_URL }} # e.g. https://interestingproject.supabase.co
34+
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
35+
OUTPUT_PATH: src/types/supabase.ts
36+
```
37+
38+
### If you don't have an existing GitHub Action workflow for your repository
39+
40+
1. Create a folder `.github/workflows` if you don't have it already
41+
2. Inside that folder, create a YAML file say `article-badge.yml`
42+
3. In the `article-badge.yml` file, you can copy the example above and modify it to your usage.
43+
4. You can choose to declare the `schedule` with a cron expression to run the job at a specified frequency e.g. every day once.
44+

0 commit comments

Comments
 (0)