Fix CI error in update swagger files (#145)

If there's no changes, the CI will end with exit 1.
<img width="689" alt="image.png" src="attachments/62248c28-6767-4b56-9e06-571e13feb867">

Co-authored-by: Lunny Xiao <lunny@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/docs/pulls/145
Reviewed-by: Lunny Xiao <lunny@noreply.gitea.com>
Co-authored-by: yp05327 <576951401@qq.com>
Co-committed-by: yp05327 <576951401@qq.com>
This commit is contained in:
yp05327
2025-01-09 18:48:57 +00:00
committed by Lunny Xiao
parent a97908040d
commit 4183476129

View File

@@ -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