From 0a13ca126b83a710385af3c1d86e729295804861 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 17 Oct 2026 09:24:07 +1300 Subject: [PATCH 1/5] CI tweaks --- .github/workflows/generate_notebooks.yml | 11 ++++++----- docs/src/notebooks/UsingMLJ/01_basics/notebook.jl | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/generate_notebooks.yml b/.github/workflows/generate_notebooks.yml index a2e1b4c..86f7e8b 100644 --- a/.github/workflows/generate_notebooks.yml +++ b/.github/workflows/generate_notebooks.yml @@ -83,14 +83,15 @@ jobs: base: ${{ github.base_ref }} title: "Commit Notebook Markdown Changes" body: | - This pull request was automatically generated by \#${{ github.event.pull_request.number }} to update regenerated - notebook markdown files. + This pull request replaces \#${{ github.event.pull_request.number }} as it additionally commits new or regenerated notebook markdown files, plot SVG's, etc. **Instructions** **Accept the invitation to run pending workflows.** If none are apparent, then - close and immediately re-open this pull request. This will commit the new - markdown and regenerate documentation. If successful, merge this pull request + close and immediately re-open this pull request. When CI finishes running, you can preview + the new documentation [here](https://JuliaAI.github.io/MLJTutorial.jl/previews/PR{{ steps.spawn_pr.outputs.pull-request-number }}. + + If happy with the preview, merge this pull request to trigger deployment of the new docs to gh-pages. You can check repository "Actions" to check when deployment is complete. @@ -109,7 +110,7 @@ jobs: **Attention** A notebook or Project.toml file has changed and new notebook - markdown has been generated. After merging this pull request, review \#${{ steps.spawn_pr.outputs.pull-request-number }} + markdown has been generated. You can close this pull request, review \#${{ steps.spawn_pr.outputs.pull-request-number }} to commit the changes and update the documentation on gh-pages, as this will need to be regenerated. diff --git a/docs/src/notebooks/UsingMLJ/01_basics/notebook.jl b/docs/src/notebooks/UsingMLJ/01_basics/notebook.jl index 2102a6c..054d91f 100644 --- a/docs/src/notebooks/UsingMLJ/01_basics/notebook.jl +++ b/docs/src/notebooks/UsingMLJ/01_basics/notebook.jl @@ -1,6 +1,6 @@ # # Lesson 1. Basics -# Notebook supporting the video series "Using MLJ". +# Notebook supporting the video series "Using MLJ". # - [Video](https://www.youtube.com/watch?v=6ILPGhuse4o&list=PLHwT4lR4GIv8&index=1) # - [Slides](slides.pdf) from the video From b1da98c046df5c30bb96e9694b5f0ff3cafb6afe Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 17 Oct 2026 09:32:00 +1300 Subject: [PATCH 2/5] fix --- .github/workflows/generate_notebooks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate_notebooks.yml b/.github/workflows/generate_notebooks.yml index 86f7e8b..2e5c979 100644 --- a/.github/workflows/generate_notebooks.yml +++ b/.github/workflows/generate_notebooks.yml @@ -89,7 +89,7 @@ jobs: **Accept the invitation to run pending workflows.** If none are apparent, then close and immediately re-open this pull request. When CI finishes running, you can preview - the new documentation [here](https://JuliaAI.github.io/MLJTutorial.jl/previews/PR{{ steps.spawn_pr.outputs.pull-request-number }}. + the new documentation [here](https://JuliaAI.github.io/MLJTutorial.jl/previews/PR${{ steps.spawn_pr.outputs.pull-request-number }}. If happy with the preview, merge this pull request to trigger deployment of the new docs to gh-pages. From 0cf621f913ebf7742420c41ee1034ed0873388e0 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 17 Oct 2026 09:34:27 +1300 Subject: [PATCH 3/5] tweak to CI --- .github/workflows/generate_notebooks.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate_notebooks.yml b/.github/workflows/generate_notebooks.yml index 2e5c979..0ea5da5 100644 --- a/.github/workflows/generate_notebooks.yml +++ b/.github/workflows/generate_notebooks.yml @@ -110,7 +110,8 @@ jobs: **Attention** A notebook or Project.toml file has changed and new notebook - markdown has been generated. You can close this pull request, review \#${{ steps.spawn_pr.outputs.pull-request-number }} - to commit the changes and update the documentation on gh-pages, as this will - need to be regenerated. + markdown has been generated. Review \#${{ steps.spawn_pr.outputs.pull-request-number }} + to commit the changes and + update the documentation on gh-pages, as this will need to be regenerated. + This PR can be **closed** at any time. From e71d39367250552f2fcac165c8a741b77a42c864 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 17 Oct 2026 20:21:06 +1300 Subject: [PATCH 4/5] Fix empty preview link in auto-generated PR body The body of the PR created by peter-evans/create-pull-request referenced steps.spawn_pr.outputs.pull-request-number from within the spawn_pr step itself. Step inputs are evaluated before the step runs, so that expression expanded to an empty string. Move the body text to a file written beforehand (passed via body-path) with a placeholder for the number, then substitute the real number and repost the body with `gh pr edit` once the PR exists. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/generate_notebooks.yml | 54 ++++++++++++++++-------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/.github/workflows/generate_notebooks.yml b/.github/workflows/generate_notebooks.yml index 0ea5da5..14bdf19 100644 --- a/.github/workflows/generate_notebooks.yml +++ b/.github/workflows/generate_notebooks.yml @@ -73,6 +73,28 @@ jobs: "$markdown_files " end + - name: Compose the pull request body + shell: bash + run: | + cat > "${{ runner.temp }}/pr-body.md" <<'EOF' + This pull request replaces \#${{ github.event.pull_request.number }} as it additionally commits new or regenerated notebook markdown files, plot SVG's, etc. + + **Instructions** + + **Accept the invitation to run pending workflows.** If none are apparent, then + close and immediately re-open this pull request. When CI finishes running, you can preview + the new documentation [here](https://JuliaAI.github.io/MLJTutorial.jl/previews/PR__SPAWNED_PR_NUMBER__). + + If happy with the preview, merge this pull request + to trigger deployment of the new docs to gh-pages. + + You can check repository "Actions" to check when deployment is complete. + You should see: ✅ **pages build and deployment** + + This pull request will automatically update if additional commits are successfully + added to the parent pull request, \#${{ github.event.pull_request.number }}. + EOF + - name: Create pull request for adding new notebook markdown id: spawn_pr uses: peter-evans/create-pull-request@v8 @@ -82,26 +104,22 @@ jobs: branch: auto-update-notebooks base: ${{ github.base_ref }} title: "Commit Notebook Markdown Changes" - body: | - This pull request replaces \#${{ github.event.pull_request.number }} as it additionally commits new or regenerated notebook markdown files, plot SVG's, etc. - - **Instructions** - - **Accept the invitation to run pending workflows.** If none are apparent, then - close and immediately re-open this pull request. When CI finishes running, you can preview - the new documentation [here](https://JuliaAI.github.io/MLJTutorial.jl/previews/PR${{ steps.spawn_pr.outputs.pull-request-number }}. - - If happy with the preview, merge this pull request - to trigger deployment of the new docs to gh-pages. - - You can check repository "Actions" to check when deployment is complete. - You should see: ✅ **pages build and deployment** - - This pull request will automatically update if additional commits are successfully - added to the parent pull request, \#${{ github.event.pull_request.number }}. - + body-path: ${{ runner.temp }}/pr-body.md delete-branch: true + # The body above cannot reference the spawned pull request's own number, because + # `steps.spawn_pr.outputs.*` is not set until after that step completes. So we + # substitute the real number into the body here instead. + - name: Insert preview link into the pull request body + if: steps.spawn_pr.outputs.pull-request-number != '' + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ steps.spawn_pr.outputs.pull-request-number }} + run: | + sed -i "s/__SPAWNED_PR_NUMBER__/${PR_NUMBER}/g" "${{ runner.temp }}/pr-body.md" + gh pr edit "$PR_NUMBER" --body-file "${{ runner.temp }}/pr-body.md" + - name: Post comment flagging further action required if: steps.spawn_pr.outputs.pull-request-operation == 'created' uses: mshick/add-pr-comment@v3 From a699f0bf904eee4633d0d0feb642c6bf8e364324 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 17 Oct 2026 20:33:40 +1300 Subject: [PATCH 5/5] tweaks to CI --- .github/workflows/generate_notebooks.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/generate_notebooks.yml b/.github/workflows/generate_notebooks.yml index 14bdf19..569f9ea 100644 --- a/.github/workflows/generate_notebooks.yml +++ b/.github/workflows/generate_notebooks.yml @@ -77,22 +77,17 @@ jobs: shell: bash run: | cat > "${{ runner.temp }}/pr-body.md" <<'EOF' - This pull request replaces \#${{ github.event.pull_request.number }} as it additionally commits new or regenerated notebook markdown files, plot SVG's, etc. + This pull request **REPLACES** \#${{ github.event.pull_request.number }} as it additionally commits new or regenerated notebook markdown files, plot SVG's, etc. **Instructions** - **Accept the invitation to run pending workflows.** If none are apparent, then - close and immediately re-open this pull request. When CI finishes running, you can preview - the new documentation [here](https://JuliaAI.github.io/MLJTutorial.jl/previews/PR__SPAWNED_PR_NUMBER__). + **Accept the invitation to run pending workflows.** If none are apparent, then close and immediately re-open this pull request. When CI finishes running, you can preview the new documentation [here](https://JuliaAI.github.io/MLJTutorial.jl/previews/PR__SPAWNED_PR_NUMBER__). - If happy with the preview, merge this pull request - to trigger deployment of the new docs to gh-pages. + If happy with the preview, merge this pull request to trigger deployment of the new docs to gh-pages. - You can check repository "Actions" to check when deployment is complete. - You should see: ✅ **pages build and deployment** + You can check repository "Actions" to check when deployment is complete. You should see: ✅ **pages build and deployment** - This pull request will automatically update if additional commits are successfully - added to the parent pull request, \#${{ github.event.pull_request.number }}. + This pull request will automatically update if additional commits are successfully added to the parent pull request, \#${{ github.event.pull_request.number }}. EOF - name: Create pull request for adding new notebook markdown @@ -127,9 +122,6 @@ jobs: message: | **Attention** - A notebook or Project.toml file has changed and new notebook - markdown has been generated. Review \#${{ steps.spawn_pr.outputs.pull-request-number }} - to commit the changes and - update the documentation on gh-pages, as this will need to be regenerated. - This PR can be **closed** at any time. + A notebook or Project.toml file has changed and new notebook markdown has been generated. **Review** \#${{ steps.spawn_pr.outputs.pull-request-number }}, which **replaces** the current PR, to commit the changes and update the documentation on gh-pages. + This PR can be **CLOSED** at any time.