From 65b94cb5f88a861e466df7c90ae97c1b9bbcfd17 Mon Sep 17 00:00:00 2001 From: Liam Howatt <30486941+liamHowatt@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:45:06 +0200 Subject: [PATCH] ci(docs): fix examples build error when not rebased fully (#8880) --- .github/workflows/compile_docs.yml | 9 ++------- scripts/build_html_examples.sh | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/compile_docs.yml b/.github/workflows/compile_docs.yml index faeafd06a9..c710ee699b 100644 --- a/.github/workflows/compile_docs.yml +++ b/.github/workflows/compile_docs.yml @@ -63,13 +63,8 @@ jobs: uses: hendrikmuhs/ccache-action@v1 - name: Build examples (with cache) run: | - if [ "${{ github.event_name }}" == "pull_request" ]; then - REPO_URL="${{ github.event.pull_request.head.repo.clone_url }}" - COMMIT_REF="${{ github.event.pull_request.head.sha }}" - else - REPO_URL="${{ github.server_url }}/${{ github.repository }}" - COMMIT_REF="${{ github.sha }}" - fi + REPO_URL="${{ github.server_url }}/${{ github.repository }}" + COMMIT_REF="${{ github.sha }}" ./scripts/build_html_examples.sh "$REPO_URL" "$COMMIT_REF" - name: Build docs run: docs/build.py html diff --git a/scripts/build_html_examples.sh b/scripts/build_html_examples.sh index 81167a9c41..ab7f00f705 100755 --- a/scripts/build_html_examples.sh +++ b/scripts/build_html_examples.sh @@ -19,6 +19,7 @@ if [ -n "$REPO_URL" ] && [ -n "$COMMIT_REF" ]; then echo "Using provided repo URL: $REPO_URL and commit ref: $COMMIT_REF for lvgl submodule" git remote set-url origin "$REPO_URL" git fetch origin + git fetch origin '+refs/pull/*:refs/remotes/origin/pull/*' git checkout "$COMMIT_REF" else CURRENT_REF="$(git rev-parse HEAD)"