From 58b3dcdebbd3e6a07622ae51e39c29aa1b9b5aca Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Fri, 5 Sep 2025 19:00:45 -0500 Subject: [PATCH] Fix git revision handling in docs workflow (#2604) 1. Fetch full git history during checkout for accurate revision info 2. Set up git config earlier in the process 3. Call generate_headers.py explicitly to ensure gitrevision.h is generated 4. Remove duplicate git config --- .github/workflows/docs_docker-run.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs_docker-run.yml b/.github/workflows/docs_docker-run.yml index 1fa64870..d6fd7384 100644 --- a/.github/workflows/docs_docker-run.yml +++ b/.github/workflows/docs_docker-run.yml @@ -31,6 +31,14 @@ jobs: - uses: actions/checkout@v4.2.2 with: submodules: recursive + fetch-depth: 0 # Fetch all history for git revision info + + - name: Set up Git + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + # Get the full git revision hash + git rev-parse HEAD > dev/gitrevision.txt + echo "Git revision: $(cat dev/gitrevision.txt)" - uses: actions/cache@v4 if: ${{ !env.ACT }} # skip during local actions testing @@ -74,9 +82,10 @@ jobs: - name: Build and install wheel using bdist_wheel shell: bash run: | - git config --global --add safe.directory /__w/CoolProp/CoolProp - echo "$(git rev-parse HEAD)" > dev/gitrevision.txt source activate docs + # Ensure the gitrevision.txt is used for the build + python dev/generate_headers.py + # Build and install the wheel pip -vv wheel . pip install -vvv --force-reinstall --ignore-installed --upgrade --no-index `ls *.whl` pip install pydata-sphinx-theme