From 418347612908fba506c890b504ce898d7ffa8660 Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Thu, 9 Jan 2025 18:48:57 +0000
Subject: [PATCH] Fix CI error in update swagger files (#145)
If there's no changes, the CI will end with exit 1.
Co-authored-by: Lunny Xiao
Reviewed-on: https://gitea.com/gitea/docs/pulls/145
Reviewed-by: Lunny Xiao
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
---
.gitea/workflows/update_swagger.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitea/workflows/update_swagger.yaml b/.gitea/workflows/update_swagger.yaml
index 423a7d83..a057411e 100644
--- a/.gitea/workflows/update_swagger.yaml
+++ b/.gitea/workflows/update_swagger.yaml
@@ -19,6 +19,7 @@ jobs:
sed -i "$@" 's/"version": "{{AppVer | JSEscape | Safe}}"/"version": "1.22.6"/' static/swagger-22.json
rm v1_json.tmpl
+ if ! [[ $(git diff --shortstat) ]]; then exit 0; fi
git config --global user.name "Gitea Bot"
git config --global user.email "teabot@gitea.io"
git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_TOKEN }}@gitea.com/gitea/docs.git