Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 33 additions & 21 deletions .github/workflows/generate_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,23 @@ 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
Expand All @@ -82,34 +99,29 @@ jobs:
branch: auto-update-notebooks
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.

**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
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
with:
message: |
**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 }}
to commit the changes and update the documentation on gh-pages, as this will
need to be regenerated.
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.

2 changes: 1 addition & 1 deletion docs/src/notebooks/UsingMLJ/01_basics/notebook.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading