-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to automatically update ODB schema weekly
- Loading branch information
1 parent
29b1a39
commit 04fcd1e
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Update schemas | ||
|
||
on: | ||
schedule: | ||
# Every week | ||
- cron: '0 0 * * 1' | ||
workflow_dispatch: | ||
# TODO: Remove after testing | ||
push: | ||
branches: | ||
- schema-gha | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-odb-schema: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout current branch (full) | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
- name: Install graphqurl | ||
run: npm install -g graphqurl | ||
- name: Fetch latest ODB schema | ||
run: ./fetchODBSchema.sh dev | ||
env: | ||
ODB_API_KEY: ${{ secrets.ODB_DEV_API_KEY }} | ||
- name: Commit and push changes | ||
run: | | ||
git config --local user.name 'lucuma-steward[bot]' | ||
git config --local user.email '106720676+lucuma-steward[bot]@users.noreply.github.com' | ||
git checkout -b update-odb-schema | ||
git add . | ||
git commit -m 'Update ODB Schema' || exit 0 | ||
git push --force --set-upstream origin update-odb-schema | ||
gh pr create --fill --base main || exit 0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |