From f39b464d3128a7cb43000e2544d11cb7d549fff6 Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Mon, 30 Oct 2023 11:15:03 +0100 Subject: [PATCH] Fix _changed.html interplay with GITHUB_PULL_REQUEST_NUMBER from workflow --- .github/workflows/deploy-gh-pages.yml | 2 ++ build_tools/build_jupyter_book.sh | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 36e39c3e1..e12f9f7c6 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -44,6 +44,8 @@ jobs: v2-refs/heads/main - name: Build the JupyterBook + env: + GITHUB_PULL_REQUEST_NUMBER: ${{github.event.number}} run: | bash build_tools/build_jupyter_book.sh diff --git a/build_tools/build_jupyter_book.sh b/build_tools/build_jupyter_book.sh index e051a8d30..d791f7baa 100755 --- a/build_tools/build_jupyter_book.sh +++ b/build_tools/build_jupyter_book.sh @@ -30,16 +30,18 @@ write_changed_html() { if [ -n "$GITHUB_PULL_REQUEST_NUMBER" ] then GITHUB_PULL_REQUEST_URL="https://github.com/inria/scikit-learn-mooc/pull/$GITHUB_PULL_REQUEST_NUMBER" - echo "The following files may have been changed by PR $GITHUB_PR_NUMBER:" + echo "The following files may have been changed by PR $GITHUB_PULL_REQUEST_NUMBER:" echo "$affected" ( echo '' - echo 'Files changed by PR '"$GITHUB_PR_URL" + echo "Files changed by PR $GITHUB_PULL_REQUEST_URL" echo '

This PR JupyterBook index' echo '' ) > "$jupyter_book_build_dir/_changed.html" + else + echo "The variable 'GITHUB_PULL_REQUEST_NUMBER' is not defined: not writing the '_changed.html' file." fi }