Skip to content

Conversation

@PedramNavid
Copy link
Collaborator

@PedramNavid PedramNavid commented Nov 11, 2025

Summary

Adds a GitHub Action workflow that automatically posts notebook diffs as PR comments when .ipynb files are modified. The diff excludes metadata, attachments, and other extraneous code while preserving the content and output changes in the notebook.

You can see an example of this in this test PR: #279 (comment)

What it does

  • Detects changed notebooks in PRs
  • Generates nbdime diffs for each changed notebook
  • Posts a formatted comment with collapsible diff sections
  • Handles multiple notebooks and new files gracefully

Test plan

  • Merge this PR
  • Create a test PR with notebook changes to verify the workflow runs
  • Confirm diff comments are posted correctly

This workflow will help reviewers quickly see what changed in notebooks without having to check out the branch locally.

🤖 Generated with Claude Code

PROOF IT WORKS

BEFORE (Github native diff)

Screenshot 2025-11-11 at 12 12 24 PM

AFTER (Diff left as a comment on a PR)

Screenshot 2025-11-11 at 12 11 24 PM

PedramNavid and others added 5 commits November 11, 2025 11:14
- Automatically detects changed .ipynb files in PRs
- Generates nbdime diffs for each changed notebook
- Posts formatted comment with collapsible diff sections
- Handles multiple notebooks and new files gracefully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Using uvx --from nbdime nbdiff creates an ephemeral environment
and avoids issues with system Python being externally managed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Adds flags to focus diff on actual content:
- --ignore-attachments: Skip attachment changes
- --ignore-metadata: Skip metadata changes
- --ignore-identifiers: Skip cell ID changes
- --ignore-details: Skip execution counts, etc.

This makes the diff more readable and focused on code/markdown changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Use short flags (-A -M -I -D) instead of long form flags that don't exist.

- -A: ignore attachments
- -M: ignore metadata
- -I: ignore identifiers (cell IDs)
- -D: ignore details (execution counts, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@PedramNavid PedramNavid merged commit b29ec6f into main Nov 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants