-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create automation for schema updates
- Loading branch information
Showing
1 changed file
with
39 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,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. |