فهرست منبع

ci: regen sdk instead of failing tests

Aiden Cline 4 ماه پیش
والد
کامیت
df67ae9cbe
2فایلهای تغییر یافته به همراه38 افزوده شده و 6 حذف شده
  1. 38 0
      .github/workflows/sdk.yml
  2. 0 6
      .github/workflows/test.yml

+ 38 - 0
.github/workflows/sdk.yml

@@ -0,0 +1,38 @@
+name: sdk
+
+on:
+  push:
+    branches-ignore:
+      - production
+  pull_request:
+    branches-ignore:
+      - production
+  workflow_dispatch:
+jobs:
+  format:
+    runs-on: blacksmith-4vcpu-ubuntu-2404
+    permissions:
+      contents: write
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Setup Bun
+        uses: ./.github/actions/setup-bun
+
+      - name: run
+        run: |
+          bun ./packages/sdk/js/script/build.ts
+          if [ -z "$(git status --porcelain)" ]; then
+            echo "No changes to commit"
+            exit 0
+          fi
+          git config --local user.email "[email protected]"
+          git config --local user.name "GitHub Action"
+          git add -A
+          git commit -m "chore: regen sdk"
+          git push --no-verify
+        env:
+          CI: true

+ 0 - 6
.github/workflows/test.yml

@@ -28,9 +28,3 @@ jobs:
           bun turbo test
         env:
           CI: true
-
-      - name: Check SDK is up to date
-        run: |
-          bun ./packages/sdk/js/script/build.ts
-          git diff --exit-code packages/sdk/js/src/gen packages/sdk/js/dist
-        continue-on-error: false