From e1aa9e6de5915bdf07c378edd4af0e1a21967026 Mon Sep 17 00:00:00 2001 From: Miran Date: Tue, 19 Mar 2024 09:56:47 +0100 Subject: [PATCH] fix commit hash when publishing book (#6097) Before, the commit hash was taken from the `gh-pages` branch, instead from the branch used to publish the book. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 990ce2e3a..71845ffd2 100644 --- a/Makefile +++ b/Makefile @@ -853,6 +853,7 @@ publish-book: | book auditors-book if [[ "$${CURRENT_BRANCH}" != "stable" && "$${CURRENT_BRANCH}" != "unstable" ]]; then \ echo -e "\nWarning: you're publishing the books from a branch that is neither 'stable' nor 'unstable'!\n"; \ fi + CURRENT_COMMIT="$$(git rev-parse --short HEAD)" && \ git branch -D gh-pages && \ git branch --track gh-pages origin/gh-pages && \ git worktree add tmp-book gh-pages && \ @@ -863,7 +864,7 @@ publish-book: | book auditors-book cp -a docs/the_auditors_handbook/book/* tmp-book/auditors-book/ && \ cd tmp-book && \ git add . && { \ - git commit -m "make publish-book $$(git rev-parse --short HEAD)" && \ + git commit -m "make publish-book $${CURRENT_COMMIT}" && \ git push origin gh-pages || true; } && \ cd .. && \ git worktree remove -f tmp-book && \