-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (42 loc) · 1.23 KB
/
backend-converted-types-check.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
name: Backend-Converted-Types-Check
on:
push:
paths:
- 'backend/pkg/api/types/**'
- 'frontend/types/api/**'
branches:
- main
- staging
pull_request:
paths:
- 'backend/pkg/api/types/**'
- 'frontend/types/api/**'
branches:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
checks: write
jobs:
build:
name: converted-types-check
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'backend/go.mod'
cache-dependency-path: 'backend/go.sum'
- name: Check if all backend-types have been converted to frontend-types
working-directory: backend
run: |
currHash=$(find ../frontend/types/api -type f -print0 | sort -z | xargs -0 sha1sum | sha256sum | head -c 64)
make frontend-types
newHash=$(find ../frontend/types/api -type f -print0 | sort -z | xargs -0 sha1sum | sha256sum | head -c 64)
if [ "$currHash" != "$newHash" ]; then
echo "frontend-types have changed, please commit the changes"
exit 1
fi