From fdb4c09d708b47e537f081b16d8e7ad3c947bd2d Mon Sep 17 00:00:00 2001 From: carnivorecookies Date: Sun, 20 Apr 2025 18:37:13 +0000 Subject: [PATCH] [mdBook template]: Fix issue causing mdBook pipeline to return failure when pushing changes that don't modify the mdBook (#88) `git commit` returns 1 if there is nothing to commit, meaning that if you `git push` any changes that don't modify the mdBook, `git` will return failure because there is nothing to commit, causing the pipeline to return failure. Adding a basic `git diff` check resolves this issue. Reviewed-on: https://codeberg.org/Codeberg-CI/examples/pulls/88 Reviewed-by: crapStone Co-authored-by: carnivorecookies Co-committed-by: carnivorecookies --- Mdbook/.woodpecker.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Mdbook/.woodpecker.yaml b/Mdbook/.woodpecker.yaml index 470439a..18773eb 100644 --- a/Mdbook/.woodpecker.yaml +++ b/Mdbook/.woodpecker.yaml @@ -49,5 +49,4 @@ steps: - cp .domains $CI_REPO_NAME || true - cd $CI_REPO_NAME - git add . - - git commit -m "Woodpecker CI ${CI_BUILD_CREATED}" - - git push + - if ! git diff --cached --quiet; then git commit -m "Woodpecker CI ${CI_BUILD_CREATED}" && git push; fi \ No newline at end of file