Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

πŸ€– Automation OpenPR

Open the Simulink models changed in a pull request β€” automatically, straight from the PR link.

Python MATLAB/Simulink GitHub CLI


πŸ“Œ What it does

Reviewing model-based (Simulink) pull requests by hand is repetitive: open the PR, read the diff, figure out which .slx / .sldd files changed, find each one in your local workspace, and open them one by one in MATLAB.

Automation OpenPR turns that whole routine into a single command. Give it a pull request URL and it opens every changed Simulink model (.slx) and data dictionary (.sldd) for you, ready to review.

Manual β†’ Automated

Step Manual With Automation OpenPR
Find changed models Read the PR diff, file by file Done for you
Locate them locally Navigate the workspace by hand Resolved from your repo path
Open in MATLAB One model at a time All of them at once
Effort per review Several manual steps openpr <pr_url>

βš™οΈ How it works

  1. Uses the GitHub CLI (gh) to fetch the pull request and list its changed files.
  2. Filters for Simulink artifacts (.slx, .sldd).
  3. Opens each one in MATLAB from your configured local repository path.

βœ… Requirements

πŸš€ Setup

Replace the placeholders (<...>) with your own values.

1. Install Python and the GitHub CLI (links above).

2. Authenticate the GitHub CLI:

gh auth login

Follow the prompts and complete the browser flow when asked.

3. Confirm the tools are available β€” in Git Bash:

gh --version
python --version

If both print a version, you're good to go.

4. Configure your local path β€” open local_config.py and set the path to your local model repository.

▢️ Usage

Run the script with a PR URL:

python /c/<your-path>/script.py <your_pr_url>

Optional: a shorter command

Create an alias so you can call it from anywhere. In Git Bash:

nano ~/.bashrc

Add this line:

alias openpr='python /c/<your-path>/script.py'

Save (Ctrl + O, then Enter) and exit (Ctrl + X), then reload:

source ~/.bashrc

Now you can simply run:

openpr <your_pr_url>

Enjoy! πŸš€


πŸ’‘ Why it exists

Model-based design reviews happen constantly, and the manual "find-and-open" step adds friction to every one of them. Automating it keeps the reviewer focused on the models, not on hunting for files around them β€” saving time on every single PR.

About

This PR introduces a Python script that automates the workflow of reviewing Simulink models linked to GitHub pull requests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors