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.
This commit is contained in:
Miran 2024-03-19 09:56:47 +01:00 committed by GitHub
parent ed1ef19bf4
commit e1aa9e6de5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

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