From d3d546fa3b5468ea449b133f5e8fe1e40c51440f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 23 Nov 2025 10:59:46 -0800 Subject: [PATCH] Fix updating swagger failure caused by no content to change --- .gitea/workflows/update_swagger.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/update_swagger.yaml b/.gitea/workflows/update_swagger.yaml index 5b82f843..b95513d1 100644 --- a/.gitea/workflows/update_swagger.yaml +++ b/.gitea/workflows/update_swagger.yaml @@ -11,11 +11,18 @@ jobs: steps: - uses: actions/checkout@v6 - run: | + set -euo pipefail + make update-api-docs 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 - git add --all - git commit -m "[skip ci] Updated swagger files" - git push + + if git status --porcelain | grep -q .; then + git add --all + git commit -m "[skip ci] Updated swagger files" + git push + else + echo "No API doc changes detected; skipping commit" + fi