Fix github action's pathname for generated types

This commit is contained in:
Jan Baykara authored and GitHub committed 2021-08-21 17:35:40 +00:00
1 parent fcf45aa429
commit 43f1a10e98
1 file changed
+3 -2
+3 -2
View File
@@ -238,14 +238,15 @@ pages:
};
```
### Update types automatically with GitHub Actions
### Update types automatically with GitHub
s
One way to keep your type definitions in sync with your database is to set up a GitHub action that runs on a schedule.
Add a script to your package.json to generate the types:
```
"update-types": "npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts"
"update-types": "npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/database/index.ts"
```
In your repo, create the file `.github/workflows/update-types.yml`. Add the following snippet into this file to define the action. If there is a change to your definitions, this script will commit the change to your repo.