Update schemas #2
This file contains hidden or 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 schemas | |
on: | |
schedule: | |
# Daily | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-odb-schema: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current branch (full) | |
uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
- name: Generate token | |
id: generate-token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: 206840 | |
private_key: ${{ secrets.WORKFLOW_GH_TOKEN }} | |
- name: Setup node | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 24 | |
cache: npm | |
- name: Install dependencies and fetch latest ODB schema | |
run: | | |
cd schemas | |
npm ci | |
./fetchODBSchema.mjs dev | |
env: | |
ODB_API_KEY: ${{ secrets.LUCUMA_DEV_API_KEY }} | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
title: Update ODB Schema | |
commit-message: Update ODB Schema | |
committer: lucuma-steward[bot] <106720676+lucuma-steward[bot]@users.noreply.github.com> | |
author: lucuma-steward[bot] <106720676+lucuma-steward[bot]@users.noreply.github.com> | |
branch: steward/update-odb-schema | |
delete-branch: true | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Check Pull Request | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |