-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(BEDS-506) add type conversion check workflow
- Loading branch information
1 parent
b8a9648
commit f5dd8ce
Showing
1 changed file
with
51 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,51 @@ | ||
name: Backend-Type-Conversion-Check | ||
on: | ||
push: | ||
paths: | ||
- 'backend/pkg/api/types/**' | ||
branches: | ||
- main | ||
- staging | ||
pull_request: | ||
paths: | ||
- 'backend/pkg/api/types/**' | ||
branches: | ||
- '*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
checks: write | ||
|
||
jobs: | ||
build: | ||
name: type-conversion-check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'backend/go.mod' | ||
cache-dependency-path: 'backend/go.sum' | ||
|
||
- name: Run TypeScript type conversion script | ||
working-directory: backend | ||
run: go run cmd/main.go typescript-converter -out ../frontend/types/api | ||
|
||
- name: Check for uncommitted changes in TypeScript types | ||
working-directory: frontend | ||
run: | | ||
git diff --exit-code types/api | ||
- name: Fail if uncommitted changes are found | ||
if: failure() | ||
run: | | ||
echo "::error::TypeScript types are outdated. Please run the conversion script and commit the updated types." | ||
exit 1 | ||