-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cd6432
commit 853fc63
Showing
1 changed file
with
35 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,35 @@ | ||
name: Check DB | ||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, synchronize, reopened, closed] | ||
jobs: | ||
check-db: | ||
runs-on: ubuntu-latest | ||
if: > | ||
github.event_name == 'pull_request' && | ||
github.event.pull_request.merged == false | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Start Service | ||
run: npm run dev & | ||
|
||
- name: Update api.json | ||
run: npm run api:download | ||
|
||
- name: Check Diff | ||
run: | | ||
IS_DIFF=$(if git status | grep -q "packages/scripts/api.json"; then echo "true"; else echo "false"; fi) | ||
echo "IS_DIFF: $IS_DIFF" | ||
if [[ $IS_DIFF == 'true' ]]; then | ||
git diff packages/scripts/api.json | ||
echo "TDesign.db and api.json data inconsistency. Workflow will fail." | ||
exit 1 | ||
fi |