Add script to check that deleted slides have redirects#3174
Open
bridadan wants to merge 1 commit intogoogle:mainfrom
Open
Add script to check that deleted slides have redirects#3174bridadan wants to merge 1 commit intogoogle:mainfrom
bridadan wants to merge 1 commit intogoogle:mainfrom
Conversation
59fcb09 to
ebb4f04
Compare
ebb4f04 to
d2f0872
Compare
djmitche
reviewed
Apr 26, 2026
| fetch-depth: 0 | ||
|
|
||
| - name: Check redirects | ||
| run: python3 .github/workflows/check-redirects.py . origin/main |
Collaborator
There was a problem hiding this comment.
It looks like this only looks at the diff in a single revision. For PRs with multiple commits, will it find the full diff?
Author
There was a problem hiding this comment.
I just tested this locally on a branch with two commits, each committing deleting one slide. The script properly detected both deleted slides, so it should work fine in CI:
$ git log
commit a1a3e4115a6a6fede4dda6518a4203c034173349 (HEAD -> check_redirects)
Author: Brian Daniels <briandaniels@google.com>
Date: Mon Apr 27 13:53:37 2026 +0000
Remove testing
commit 134f009a6d068a3c060729ab1c0abaa5a57128c2
Author: Brian Daniels <briandaniels@google.com>
Date: Mon Apr 27 13:53:28 2026 +0000
Remove hello-world
commit d2f0872c3af1b78405df6d8adaa20725454703b8 (bridadan/check_redirects)
Author: Brian Daniels <briandaniels@google.com>
Date: Fri Apr 17 20:21:55 2026 +0000
Add script to check that deleted slides have redirects
commit 03130e81a8e2aa732fbaeac8016ae94193c9bb0b (origin/main, origin/HEAD)
Author: Nicole L <dlegare.1001@gmail.com>
Date: Tue Apr 14 13:13:48 2026 -0700
Idiomatic: Use reference-style links in signposting slide (#3161)
Using inline links in doc comments can result in really long lines that
are unwieldy and hard to parse when looking at the unrendered source
comments. I'd like to show students that you can use the reference style
links to keep the source comment readable while still taking advantage
of markdown links to point readers to external resources.
$ python .github/workflows/check-redirects.py . origin/main
The following deleted files are missing a redirect entry in book.toml:
src/hello-world.md
src/testing.md
Collaborator
There was a problem hiding this comment.
Awesome, thanks for checking!
djmitche
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1417.
This adds a script and a CI job to ensure that slides that are deleted have a matching redirect entry in
bool.toml.If a redirect entry is not found (for example, for
src/hello-world.md), the following is printed before exiting with a status of 1: