1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-07 06:55:42 +02:00

Comment PRs with updated schedule information (#1576)

This adds a GH action to add a comment to every PR giving the updated
course schedule with the PR merged.

To accomplish this, I broke `mdbook-course` into a library and two
binaries, allowing the mdbook content to be loaded dynamically outside
of an `mdbook build` invocation.

I think this is a net benefit, but possible improvements include:
* diffing the "before" and "after" schedules and only making the comment
when those are not the same (or replacing the comment with "no schedule
changes")
* including per-segment timing behind `<details>` (with a few minutes
effort I couldn't get this to play nicely with the markdown lists)

---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
This commit is contained in:
Dustin J. Mitchell
2024-01-12 10:53:09 -05:00
committed by GitHub
parent 23ba2aa42f
commit 4c0833a22e
15 changed files with 151 additions and 56 deletions

27
.github/workflows/course-schedule.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: "Course Schedule Updates"
on:
pull_request:
paths:
- "src/**.md"
jobs:
course-schedule:
runs-on: ubuntu-latest
name: Make Course Schedule Comment
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust cache
uses: ./.github/workflows/setup-rust-cache
- name: Generate Schedule
run: cargo run -p mdbook-course --bin course-schedule > course-schedule.md
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
filePath: course-schedule.md
comment_tag: course-schedule