-
Notifications
You must be signed in to change notification settings - Fork 17
48 lines (39 loc) · 1.19 KB
/
schema_generation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Verify Schema Generation
on:
pull_request:
branches: main
env:
GO_VER: '1.23.*'
jobs:
verify-schema-generation:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure the full history is fetched for proper diffing
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VER }}
cache: false
- name: Install Taskfile
run: |
go install github.com/go-task/task/v3/cmd/task@latest
- name: Install Dependencies
run: |
task install-deps
- name: Run 'task gen-schema'
run: |
task all-code-gen
- name: Check for Uncommitted Changes
run: |
git config --global --add safe.directory /github/workspace
if [[ $(git status --porcelain) ]]; then
echo "Uncommitted changes detected after running 'task gen-schema'."
echo "Please run 'task gen-schema' and commit the changes."
git diff
exit 1
else
echo "No changes detected. Generated code is up to date."
fi