From dd2251c9340017d03fc20189d7ea53289d46a14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 20 Oct 2023 21:48:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?ci(checkDB):=20=E6=A3=80=E6=9F=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=8F=91=E9=80=81=E7=95=99=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-db.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-db.yml b/.github/workflows/check-db.yml index f80cb7677..b1607e443 100644 --- a/.github/workflows/check-db.yml +++ b/.github/workflows/check-db.yml @@ -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 \ No newline at end of file + echo IS_DIFF=$(if git status | grep -q "packages/scripts/api.json"; then echo "true"; else echo "false"; fi) + + - name: Comment + if: ${{steps.check_diff.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.IS_DIFF=='true'}} + run: | + git diff packages/scripts/api.json + exit 1 \ No newline at end of file From 49950b73d36290ba8127c088dd17470a0c5b8964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 20 Oct 2023 21:53:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-db.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-db.yml b/.github/workflows/check-db.yml index b1607e443..ea521cd50 100644 --- a/.github/workflows/check-db.yml +++ b/.github/workflows/check-db.yml @@ -30,7 +30,7 @@ jobs: echo IS_DIFF=$(if git status | grep -q "packages/scripts/api.json"; then echo "true"; else echo "false"; fi) - name: Comment - if: ${{steps.check_diff.IS_DIFF=='true'}} + if: ${{steps.check_diff.outputs.IS_DIFF=='true'}} uses: actions-cool/maintain-one-comment@v2.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -38,7 +38,7 @@ jobs: `TDesign.db`和`api.json`数据不一致,请执行`npm run api:download`。 - name: Error - if: ${{steps.check_diff.IS_DIFF=='true'}} + if: ${{steps.check_diff.outputs.IS_DIFF=='true'}} run: | git diff packages/scripts/api.json exit 1 \ No newline at end of file From 775c93cbff58820c0e7458959fdce02758baa3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 20 Oct 2023 21:58:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-db.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-db.yml b/.github/workflows/check-db.yml index ea521cd50..14dfdc2d4 100644 --- a/.github/workflows/check-db.yml +++ b/.github/workflows/check-db.yml @@ -30,7 +30,7 @@ jobs: echo IS_DIFF=$(if git status | grep -q "packages/scripts/api.json"; then echo "true"; else echo "false"; fi) - name: Comment - if: ${{steps.check_diff.outputs.IS_DIFF=='true'}} + if: steps.check_diff.outputs.IS_DIFF=='true' uses: actions-cool/maintain-one-comment@v2.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -38,7 +38,7 @@ jobs: `TDesign.db`和`api.json`数据不一致,请执行`npm run api:download`。 - name: Error - if: ${{steps.check_diff.outputs.IS_DIFF=='true'}} + if: steps.check_diff.outputs.IS_DIFF=='true' run: | git diff packages/scripts/api.json exit 1 \ No newline at end of file From e2b25cf0d2ed67709def7be11d312640095b943c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 20 Oct 2023 22:19:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=BE=93=E5=87=BA=20IS=5FDIFF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-db.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-db.yml b/.github/workflows/check-db.yml index 14dfdc2d4..822bacc35 100644 --- a/.github/workflows/check-db.yml +++ b/.github/workflows/check-db.yml @@ -27,10 +27,10 @@ jobs: - name: Check Diff id: check_diff run: | - echo IS_DIFF=$(if git status | grep -q "packages/scripts/api.json"; then echo "true"; else echo "false"; 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' + if: steps.check_diff.outputs.IS_DIFF=='true' uses: actions-cool/maintain-one-comment@v2.0.0 with: token: ${{ secrets.GITHUB_TOKEN }}