File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2- """Synchronize/clean up images submitted with a paper PR.
3-
4- This is designed to run in a pull_request_target workflow, *without checking out the PR code*.
5-
6- Behavior:
7- - Detect added image files in the PR under docs/src/public/images.
8- - Download the image bytes from the PR head SHA via GitHub API.
9- - Resize/compress to a standard size.
10- - Create a branch + PR in the docs repository containing the processed images.
11- - Comment on the original PR with the new image URLs and suggested edits.
12-
13- If the PR branch is on the same repository (not a fork), we also attempt to:
14- - checkout the PR branch,
15- - delete the image files from PySR,
16- - update docs/papers.yml image fields to use the absolute URL,
17- - push the commit back to the PR branch.
18-
19- Security notes:
20- - Never executes PR-provided code.
21- - Uses GitHub API to fetch only the specific image files and (optionally) papers.yml.
2+ """CI helper for paper PRs: upload/normalize images and comment back with URLs.
3+
4+ Runs in pull_request_target; never executes PR-provided code.
225"""
236
247from __future__ import annotations
You can’t perform that action at this time.
0 commit comments