Update database types #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update database types | |
on: | |
schedule: | |
# sets the action to run daily. You can modify this to run the action more or less frequently | |
- cron: "0 0 * * *" | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
env: | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
PROJECT_REF: tuyftpyubgtivyvtpnbg | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- uses: actions/setup-node@v2.1.5 | |
with: | |
node-version: 16 | |
- run: npm run update-types | |
- name: check for file changes | |
id: git_status | |
run: | | |
echo "::set-output name=status::$(git status -s)" | |
- name: Commit files | |
if: ${{contains(steps.git_status.outputs.status, ' ')}} | |
run: | | |
git add types/database/index.ts | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -m "Update database types" -a | |
- name: Push changes | |
if: ${{contains(steps.git_status.outputs.status, ' ')}} | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |