From 355f7fb41e9875f1cf7e5772bf7b10429a0a65f0 Mon Sep 17 00:00:00 2001
From: SonMooSans <god63820869@gmail.com>
Date: Thu, 21 Sep 2023 20:21:42 +0800
Subject: [PATCH] Fix release workflow

---
 .github/workflows/release.yml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index fb654f94a..0c36e3438 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,10 +27,8 @@ jobs:
       - name: Install Dependencies
         run: pnpm i
 
-      - name: Update Examples in create-next-docs-app
-        run: pnpm update-example
-
       - name: Create Release Pull Request or Publish to npm
+        id: changesets
         uses: changesets/action@v1
         with:
           publish: pnpm run release
@@ -38,3 +36,7 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+      - name: Update create-next-docs-app Version
+        if: steps.changesets.outputs.published == 'true'
+        run: pnpm update-example