Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(checkDB): 检查失败发送留言 #198

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/check-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ jobs:
run: npm run api:download

- name: Check Diff
id: 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
echo "IS_DIFF=$(if git status | grep -q "packages/scripts/api.json"; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT

- name: Comment
if: steps.check_diff.outputs.IS_DIFF=='true'
uses: actions-cool/maintain-one-comment@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
`TDesign.db`和`api.json`数据不一致,请执行`npm run api:download`。

- name: Error
if: steps.check_diff.outputs.IS_DIFF=='true'
run: |
git diff packages/scripts/api.json
exit 1