Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create automation for schema updates #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/schema-update.yaml
@@ -0,0 +1,39 @@
---
name: Update Schema
on:
workflow_dispatch:
schedule:
- cron: 0 2 * * *

jobs:
update-schema:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: "1.17"

- name: Run go generate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go mod init github.com/shurcooL/githubv4
go mod tidy
go generate
rm go.mod
rm go.sum

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore: Update schema"
delete-branch: true
title: "[automation] Update with the latest schema changes"
body: Automated pull request to update the schema based on detected changes.