Skip to content

Conversation

@MilesCranmerBot
Copy link

@MilesCranmerBot MilesCranmerBot commented Jan 30, 2026

Adds a label-gated (paper-image-sync) pull_request_target workflow to handle paper PR images safely.

  • Detects newly added images under docs/src/public/images/ in the PR
  • Downloads + resizes/compresses (max width 800px, quality 80)
  • Converts images to JPEG always (alpha flattened to white)
  • Uploads processed images to MilesCranmer/PySR_Docs (images/) and opens a docs PR
  • Comments back with raw.githubusercontent.com/.../images/<file>.jpg URLs to paste into docs/papers.yml
  • If the PR branch is in-repo (not a fork), can also remove the images from the PR branch and update docs/papers.yml

Requires adding secret PYSR_DOCS_TOKEN to MilesCranmer/PySR with write access to MilesCranmer/PySR_Docs.

@MilesCranmerBot MilesCranmerBot force-pushed the bot/paper-image-workflow branch 2 times, most recently from 0f28b00 to d3cfce1 Compare January 31, 2026 00:53
@MilesCranmerBot MilesCranmerBot force-pushed the bot/paper-image-workflow branch from d3cfce1 to 9ad9802 Compare January 31, 2026 00:56
@MilesCranmerBot
Copy link
Author

Added a simple-but-robust validator + CI job:

  • new scripts/validate_papers_yml.py checks docs/papers.yml parses + basic schema, and validates image: is either http(s) or an existing basename under docs/src/public/images/.
  • CI job Validate docs/papers.yml runs on PRs.

This should catch the common formatting issues you’d otherwise check manually.

@MilesCranmerBot MilesCranmerBot force-pushed the bot/paper-image-workflow branch from 94f47fa to 8a65c81 Compare January 31, 2026 01:16
@MilesCranmerBot
Copy link
Author

Update: adjusted the validator so it does not accept arbitrary image URLs. If image: is a URL, it must be the stable raw.githubusercontent.com/MilesCranmer/PySR_Docs/(master|refs/heads/master)/images/... form (and it still rejects the temporary paper-images/pr-... URLs). Otherwise, authors should upload the image in the PR and set image: to the local filename under docs/src/public/images/.

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.

1 participant